SSE鉴权失效停止重连清理会话跳登录并降噪4xx错误日志

This commit is contained in:
yml2213
2026-08-23 11:01:41 +08:00
parent 8e49b7d047
commit 70b31f4874
4 changed files with 32 additions and 9 deletions
+2 -1
View File
@@ -56,7 +56,8 @@ export function sendRouteError(
logger(scope, fallbackMessage, {
statusCode: classification.statusCode,
errorCode: classification.errorCode,
error,
// 4xx 属预期失败(鉴权过期、参数错误等),带上完整错误对象只会刷十几行堆栈;仅 5xx 保留排查所需详情。
...(classification.statusCode >= 500 ? { error } : {}),
})
res.status(classification.statusCode).json(buildErrorPayload(error, fallbackMessage))
}