From 8c642d79c28291ba2b43303c7cd346ce680f8d44 Mon Sep 17 00:00:00 2001 From: QCQCQC <1220204124@zust.edu.cn> Date: Thu, 16 Oct 2025 11:08:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E4=B8=80=E5=B1=82catc?= =?UTF-8?q?h=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/server/start.js | 2 ++ src/server/start.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/server/start.js b/lib/server/start.js index b99c28f..940c38b 100644 --- a/lib/server/start.js +++ b/lib/server/start.js @@ -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; diff --git a/src/server/start.ts b/src/server/start.ts index 6911d9d..da2fbb7 100644 --- a/src/server/start.ts +++ b/src/server/start.ts @@ -219,6 +219,8 @@ export async function startup { await errorHandler( props.caller, props.args, ctx); + }).catch((err) => { + console.warn('执行全局错误处理失败:', err); }); } return props.args;