Skip to content

Commit dcb7f7c

Browse files
authored
ref: Log promise rejection reason alongside eventid (#434)
1 parent b61e077 commit dcb7f7c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/client.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,17 @@ extend(Raven.prototype, {
123123
global.process.on('unhandledRejection', function(reason, promise) {
124124
var context = promise.domain && promise.domain.sentryContext;
125125
self.captureException(reason, context || {}, function(sendErr, eventId) {
126-
if (!sendErr) utils.consoleAlert('unhandledRejection captured: ' + eventId);
126+
if (!sendErr) {
127+
var reasonMessage = (reason && reason.message) || reason;
128+
utils.consoleAlert(
129+
'unhandledRejection captured\n' +
130+
'Event ID: ' +
131+
eventId +
132+
'\n' +
133+
'Reason: ' +
134+
reasonMessage
135+
);
136+
}
127137
});
128138
});
129139
}

0 commit comments

Comments
 (0)