mirror of https://github.com/Chocobozzz/PeerTube
Add more info to client error stacktrace
parent
7804e577de
commit
426a8cab45
|
@ -95,9 +95,9 @@ class Logger {
|
|||
}
|
||||
|
||||
private buildStackServerLogPayload (message: LoggerMessage, meta?: LoggerMeta) {
|
||||
if (message instanceof Error) return message.stack
|
||||
if (meta instanceof Error) return meta.stack
|
||||
if (meta?.err instanceof Error) return meta.err.stack
|
||||
if (message instanceof Error) return this.buildStack(message)
|
||||
if (meta instanceof Error) return this.buildStack(meta)
|
||||
if (meta?.err instanceof Error) return this.buildStack(meta.err)
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
@ -128,6 +128,11 @@ class Logger {
|
|||
hookObj.hook(message, meta)
|
||||
}
|
||||
}
|
||||
|
||||
private buildStack (err: Error) {
|
||||
return `${err.message}\n${err.stack || ''}`
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const logger = window.logger || new Logger()
|
||||
|
|
Loading…
Reference in New Issue