fix: 添加一层catch处理

This commit is contained in:
Pan Qiancheng 2025-10-16 11:08:33 +08:00
parent be24825206
commit 8c642d79c2
2 changed files with 4 additions and 0 deletions

View File

@ -171,6 +171,8 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
if (props.level === "error") {
appLoader.execRoutine(async (ctx) => {
await errorHandler(props.caller, props.args, ctx);
}).catch((err) => {
console.warn('执行全局错误处理失败:', err);
});
}
return props.args;

View File

@ -219,6 +219,8 @@ export async function startup<ED extends EntityDict & BaseEntityDict, FrontCxt e
if (props.level === "error") {
appLoader.execRoutine(async (ctx) => {
await errorHandler( props.caller, props.args, ctx);
}).catch((err) => {
console.warn('执行全局错误处理失败:', err);
});
}
return props.args;