aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/root-helpers/logger.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/client/src/root-helpers/logger.ts b/client/src/root-helpers/logger.ts
index cd559cfa7..0dcda525e 100644
--- a/client/src/root-helpers/logger.ts
+++ b/client/src/root-helpers/logger.ts
@@ -95,9 +95,9 @@ class Logger {
95 } 95 }
96 96
97 private buildStackServerLogPayload (message: LoggerMessage, meta?: LoggerMeta) { 97 private buildStackServerLogPayload (message: LoggerMessage, meta?: LoggerMeta) {
98 if (message instanceof Error) return message.stack 98 if (message instanceof Error) return this.buildStack(message)
99 if (meta instanceof Error) return meta.stack 99 if (meta instanceof Error) return this.buildStack(meta)
100 if (meta?.err instanceof Error) return meta.err.stack 100 if (meta?.err instanceof Error) return this.buildStack(meta.err)
101 101
102 return undefined 102 return undefined
103 } 103 }
@@ -128,6 +128,11 @@ class Logger {
128 hookObj.hook(message, meta) 128 hookObj.hook(message, meta)
129 } 129 }
130 } 130 }
131
132 private buildStack (err: Error) {
133 return `${err.message}\n${err.stack || ''}`
134
135 }
131} 136}
132 137
133const logger = window.logger || new Logger() 138const logger = window.logger || new Logger()