Skip to content

Commit

Permalink
feat(server): print stack of unhandledrejections (#3593)
Browse files Browse the repository at this point in the history
* 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.

Co-authored-by: Jonathan Ginsburg <jginsburgn@google.com>
  • Loading branch information
johnjbarton and Jonathan Ginsburg authored Dec 18, 2020
1 parent 4a8178f commit 35a5842
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down

0 comments on commit 35a5842

Please sign in to comment.