exception
ee-core:v2.0.3
# 介绍
捕获异常模块。主进程和childJob功能已经启用。如果你有自己实现的子进程功能,才需要使用。
# 使用方法
const Exception = require('ee-core/exception');
# API列表
# start()
开启异常捕获。会同时调用 uncaughtExceptionHandler() / unhandledRejectionHandler()
Exception.start();
# uncaughtExceptionHandler()
当进程上抛出异常而没有被捕获时触发该事件,并且使异常静默
# unhandledRejectionHandler()
当promise中reject的异常在同步任务中没有使用catch捕获就会触发该事件,即便是在异步情况下使用了catch也会触发该事件。
上次更新: 2025/02/08, 11:20:40