bugsnag/bugsnag-js

NodeJS: Bugsnag doesn't end the process on unhandled promise rejection

leandrogoe opened this issue · 1 comments

Describe the bug

In NodeJS, when an unhandled promise rejection takes place Bugsnag will report the error but the process will remain alive.

This is documented in the Bugsnag documentation:

By default, when an unhandled rejection occurs, BugSnag will send an error report, then print the error to the console. The process remains alive, as per Node’s current default behavior.

Despite this comment is useful, it is partially incorrect as Node's current default behaviour is not to keep the process alive, but to terminate it with exit code 1. This behavior was introduced in NodeJS version 7, so it is well established by now.

In the best case, this is inaccurate documentation, but it is also violating the principle of least surprise. I don't think adding a library like Bugsnag should change what Node does by default.

Environment

  • Bugsnag version: 7.20.2
  • NodeJS version: v18.12.1

Hi @leandrogoe.

Thanks for raising, this is something that we are aware of. We're working on some improvements in our Node support which will address this. A release for this is coming in the next quarter. We will let you know as soon as we have an update.