Skip to content

Commit 530c258

Browse files
kumaviskamilogorek
authored andcommitted
feat: add flag for unhandled promise rejections
1 parent 354c7cd commit 530c258

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/client.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ extend(Raven.prototype, {
121121
if (this.captureUnhandledRejections) {
122122
var self = this;
123123
global.process.on('unhandledRejection', function(reason, promise) {
124-
var context = promise.domain && promise.domain.sentryContext;
125-
self.captureException(reason, context || {}, function(sendErr, eventId) {
124+
var context = (promise.domain && promise.domain.sentryContext) || {};
125+
context.extra = context.extra || {};
126+
context.extra.unhandledPromiseRejection = true;
127+
self.captureException(reason, context, function(sendErr, eventId) {
126128
if (!sendErr) {
127129
var reasonMessage = (reason && reason.message) || reason;
128130
utils.consoleAlert(

0 commit comments

Comments
 (0)