fix: 更新router报错

This commit is contained in:
2024-11-17 16:43:24 +08:00
parent 2393dfe273
commit 7f369b7b07
2 changed files with 3 additions and 2 deletions

View File

@@ -363,10 +363,11 @@ export class QueryRouter {
} catch (e) {
if (route?.isDebug) {
console.error('=====debug====:middlerware error');
console.error('=====debug====:', e);
console.error('=====debug====:[path:key]:', `${route.path}-${route.key}`);
console.error('=====debug====:', e.message);
}
if (e instanceof CustomError) {
if (e instanceof CustomError || e?.code) {
ctx.code = e.code;
ctx.message = e.message;
ctx.body = null;