fix: Show error log (#14960)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2024-05-10 08:47:57 +01:00
1 parent c65dca9486
commit a136511c8a
2 files changed
+5 -1

No files matched your search

+2 -1
View File
@@ -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);