Comparing version 0.4.4 to 0.4.5
# Change Log | ||
**0.4.5** | ||
- Fix a bug that was causing the notifier to not catch all uncaught exceptions. ([#36](https://github.com/rollbar/node_rollbar/pull/36)) | ||
**0.4.4** | ||
@@ -4,0 +7,0 @@ - Fix a bug when `req.socket` was undefined. ([#33](https://github.com/rollbar/node_rollbar/pull/33)) |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"repository": "git://github.com/rollbar/node_rollbar.git", | ||
@@ -16,0 +16,0 @@ "author": "Rollbar, Inc. <support@rollbar.com>", |
@@ -87,3 +87,3 @@ # Rollbar notifier for Node.js [![Build Status](https://secure.travis-ci.org/rollbar/node_rollbar.png?branch=master)](https://travis-ci.org/rollbar/node_rollbar) | ||
// | ||
// Default: true | ||
// Default: false | ||
exitOnUncaughtException: true | ||
@@ -90,0 +90,0 @@ }; |
@@ -235,8 +235,7 @@ var api = require('./lib/api'); | ||
/* | ||
* Registers a handler for the process.uncaughtException event. The handler | ||
* will immediately send the uncaught exception + all queued items to rollbar | ||
* and then shut down the rollbar library via rollbar.shutdown(). | ||
* Registers a handler for the process.uncaughtException event. | ||
* | ||
* If options.exitOnUncaught is set, the notifier will optionally call process.exit(1) | ||
* once the rollbar items are processed. | ||
* If options.exitOnUncaughtException is set to true, the notifier will | ||
* immediately send the uncaught exception + all queued items to rollbar, | ||
* then call process.exit(1). | ||
* | ||
@@ -248,3 +247,3 @@ * Note: The node.js authors advise against using these type of handlers. | ||
// Default to exiting on uncaught exceptions unless options.exitOnUncaughtException is set | ||
// Default to not exiting on uncaught exceptions unless options.exitOnUncaughtException is set. | ||
options = options || {}; | ||
@@ -257,7 +256,10 @@ var exitOnUncaught = options.exitOnUncaughtException === undefined ? false : !!options.exitOnUncaughtException; | ||
if (initialized) { | ||
process.once('uncaughtException', function(err) { | ||
console.error('[Rollbar] Handling uncaught exception'); | ||
process.on('uncaughtException', function(err) { | ||
console.error('[Rollbar] Handling uncaught exception.'); | ||
console.error(err); | ||
notifier.changeHandler('inline'); | ||
if (exitOnUncaught) { | ||
notifier.changeHandler('inline'); | ||
} | ||
notifier.handleError(err, function(err) { | ||
@@ -268,7 +270,8 @@ if (err) { | ||
} | ||
exports.shutdown(function(e) { | ||
if (exitOnUncaught) { | ||
if (exitOnUncaught) { | ||
exports.shutdown(function(e) { | ||
process.exit(1); | ||
} | ||
}); | ||
}); | ||
} | ||
}); | ||
@@ -275,0 +278,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
63996
1399