Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat: add flag for unhandled promise rejections
Browse files Browse the repository at this point in the history
  • Loading branch information
kumavis authored and kamilogorek committed Apr 9, 2018
1 parent 354c7cd commit 530c258
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ extend(Raven.prototype, {
if (this.captureUnhandledRejections) {
var self = this;
global.process.on('unhandledRejection', function(reason, promise) {
var context = promise.domain && promise.domain.sentryContext;
self.captureException(reason, context || {}, function(sendErr, eventId) {
var context = (promise.domain && promise.domain.sentryContext) || {};
context.extra = context.extra || {};
context.extra.unhandledPromiseRejection = true;
self.captureException(reason, context, function(sendErr, eventId) {
if (!sendErr) {
var reasonMessage = (reason && reason.message) || reason;
utils.consoleAlert(
Expand Down

0 comments on commit 530c258

Please sign in to comment.