Skip to content

Commit

Permalink
fix(server): Report original error message
Browse files Browse the repository at this point in the history
Display original error message of plugins like: karma-browserstack-launcher, karma-cbt-launcher.

Fixes #3414
  • Loading branch information
Borewit committed Feb 10, 2020
1 parent 1fc51b0 commit ec854a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,18 @@ class Server extends KarmaEventEmitter {
processWrapper.on('SIGTERM', disconnectBrowsers)

const reportError = (error) => {
process.emit('infrastructure_error', error)
process.emit(`infrastructure_error: ${error.message || String(error)}`
disconnectBrowsers(1)
this.log.error(error)
}

processWrapper.on('unhandledRejection', (error) => {
this.log.error('UnhandledRejection')
this.log.error(`UnhandledRejection: ${error.message || String(error)}`)
reportError(error)
})

processWrapper.on('uncaughtException', (error) => {
this.log.error('UncaughtException')
this.log.error(`UncaughtException:: ${error.message || String(error)}`)
reportError(error)
})
}
Expand Down

0 comments on commit ec854a2

Please sign in to comment.