Comparing version 2.0.1 to 2.1.0
@@ -6,2 +6,5 @@ Node Airbrake Changelog | ||
* Added `airbrake.handlePromiseRejections()` | ||
([#147](https://github.com/airbrake/node-airbrake/pull/147)) | ||
### [v2.0.1][v2.0.1] (May 16, 2017) | ||
@@ -120,1 +123,2 @@ | ||
[v2.0.1]: https://github.com/airbrake/node-airbrake/releases/tag/v2.0.1 | ||
[v2.1.0]: https://github.com/airbrake/node-airbrake/releases/tag/v2.1.0 |
@@ -160,2 +160,10 @@ var pkg = require('../package.json'); | ||
Airbrake.prototype.handlePromiseRejections = function(die) { | ||
var self = this; | ||
var shouldDie = (typeof die === 'undefined') ? true : die; | ||
process.on('unhandledRejection', function(reason) { | ||
self._onError(reason, shouldDie); | ||
}); | ||
}; | ||
Airbrake.prototype.log = function(str) { | ||
@@ -162,0 +170,0 @@ if (this.consoleLogError) { |
@@ -21,3 +21,3 @@ { | ||
"description": "A Node.js notifier for Airbrake, the leading exception reporting service.", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"homepage": "https://github.com/airbrake/node-airbrake", | ||
@@ -24,0 +24,0 @@ "repository": { |
@@ -46,3 +46,3 @@ Node Airbrake | ||
"dependencies": { | ||
"airbrake": "^2.0.1" | ||
"airbrake": "^2.1.0" | ||
} | ||
@@ -140,5 +140,2 @@ } | ||
By default only the errors from the production environment will get reported, | ||
so make sure to put `production` in your `NODE_ENV`. | ||
### Severity | ||
@@ -345,2 +342,8 @@ | ||
### airbrake.handlePromiseRejections() | ||
Registers a `process.on('unhandledRejection')` listener. When an uncaught | ||
exception occurs inside a promise, the error is sent to Airbrake, and then re-thrown to | ||
kill the process. | ||
### airbrake.expressHandler(disableUncaughtException) | ||
@@ -347,0 +350,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63309
31
1339
397
26