fix: Show error log (#14960)
This commit is contained in:
1 parent
c65dca9486
commit
a136511c8a
2 files changed
+5
-1
No files matched your search
@@ -5,7 +5,8 @@ export function safeStringify(obj: unknown) {
|
||||
try {
|
||||
if (obj instanceof Error) {
|
||||
// Errors don't serialize well, so we extract what we want
|
||||
return obj.stack ?? obj.message;
|
||||
// We stringify so that we can log the error message and stack trace in a single log event
|
||||
return JSON.stringify(obj.stack ?? obj.message);
|
||||
}
|
||||
// Avoid crashing on circular references
|
||||
return JSON.stringify(obj);
|
||||
|
||||
Reference in new issue
Block a user