refactor(server): auto print full stack on logger.error (#10161)

This commit is contained in:
fengmk2
2025-02-13 11:49:41 +00:00
parent 899b1d60e0
commit 3ff721abe8
5 changed files with 113 additions and 21 deletions

View File

@@ -152,11 +152,7 @@ export class UserFriendlyError extends Error {
if (debugInfo) {
message += ` (${JSON.stringify(debugInfo)})`;
}
let stack = this.stack ?? '';
if (this.cause) {
stack += `\n\nCaused by:\n\n${(this.cause as any).stack ?? this.cause}`;
}
fn.call(logger, message, stack);
fn.call(logger, message, this);
}
}