diff --git a/lib/bugsnag.js b/lib/bugsnag.js index 742c19c..36afd40 100644 --- a/lib/bugsnag.js +++ b/lib/bugsnag.js @@ -73,7 +73,6 @@ function autoNotifyCallback(notifiedError, uncaughtError) { errorMsg.push(notifiedError.stack); } } - errorMsg.push(""); Configuration.logger.error(errorMsg.join('\n')); } if (Configuration.onUncaughtError && uncaughtError) { diff --git a/lib/configuration.js b/lib/configuration.js index f364489..b507121 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -32,11 +32,16 @@ var Configuration = { onUncaughtError: function(err) { if ((err instanceof Error) && err.domain) { if (err.domainThrown || err.domainEmitter || err.domainThrown === void 0) { - Configuration.logger.error(err.stack || err); - return process.exit(1); + var context = ""; + if (err.domain._bugsnagOptions && err.domain._bugsnagOptions.cleanedRequest) { + context += " at " + err.domain._bugsnagOptions.cleanedRequest.httpMethod + context += " " + err.domain._bugsnagOptions.cleanedRequest.path + "" + } + Configuration.logger.error("Encountered an uncaught error" + context + " terminating…\n" + (err.stack || err)); + return process.exit(1); } } else { - Configuration.logger.error(err.stack || err); + Configuration.logger.error("Encountered an uncaught error, terminating…\n" + (err.stack || err)); return process.exit(1); } },