diff --git a/lib/bugsnag.js b/lib/bugsnag.js index 7b13a97..02f2050 100644 --- a/lib/bugsnag.js +++ b/lib/bugsnag.js @@ -66,8 +66,12 @@ function autoNotifyCallback(notifiedError, uncaughtError) { errorMsg.push("configuration options prevent the following error from being sent to Bugsnag."); errorMsg.push("https://docs.bugsnag.com/platforms/nodejs/other/configuration-options/#notifyreleasestages"); } - errorMsg.push(""); - errorMsg.push(notifiedError.stack); + // only print caught errors at this point. uncaught errors get printed by + // the onUncaughtError function later so this prevents duplicate logs + if (!(Configuration.onUncaughtError && uncaughtError)) { + errorMsg.push(""); + errorMsg.push(notifiedError.stack); + } } errorMsg.push(""); Configuration.logger.error(errorMsg.join('\n'));