From 593a4f4a984b4d370a3118ade2bd45749e74df6d Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Thu, 17 Dec 2020 10:23:31 -0800 Subject: [PATCH 1/2] feat(server): print stack of unhandledrejections The v8 engine includes the error with the stack and most of the time we need the stack also. --- lib/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index 238caa09c..2bcf29ec2 100644 --- a/lib/server.js +++ b/lib/server.js @@ -417,12 +417,12 @@ class Server extends KarmaEventEmitter { } processWrapper.on('unhandledRejection', (error) => { - this.log.error(`UnhandledRejection: ${error.message || String(error)}`) + this.log.error(`UnhandledRejection: ${error.stack || error.message || String(error)}`) reportError(error) }) processWrapper.on('uncaughtException', (error) => { - this.log.error(`UncaughtException:: ${error.message || String(error)}`) + this.log.error(`UncaughtException:: ${error.stack || error.message || String(error)}`) reportError(error) }) } From d94c477771b76dc20d97ee44325648f7021a9b87 Mon Sep 17 00:00:00 2001 From: Jonathan Ginsburg Date: Thu, 17 Dec 2020 13:56:35 -0600 Subject: [PATCH 2/2] feat(server): print stack of unhandledrejections The v8 engine includes the error with the stack and most of the time we need the stack also. --- lib/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server.js b/lib/server.js index 2bcf29ec2..7c1d9224e 100644 --- a/lib/server.js +++ b/lib/server.js @@ -422,7 +422,7 @@ class Server extends KarmaEventEmitter { }) processWrapper.on('uncaughtException', (error) => { - this.log.error(`UncaughtException:: ${error.stack || error.message || String(error)}`) + this.log.error(`UncaughtException: ${error.stack || error.message || String(error)}`) reportError(error) }) }