Skip to content

Commit 7392140

Browse files
committed
Send unhandled RSVP errors that don't provide an Error.
1 parent 759cfaf commit 7392140

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

plugins/ember.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ Ember.onerror = function EmberOnError(error) {
1818
_oldOnError.call(this, error);
1919
}
2020
};
21-
Ember.RSVP.on('error', function (err) {
22-
Raven.captureException(err);
21+
Ember.RSVP.on('error', function (reason) {
22+
if (reason instanceof Error) {
23+
Raven.captureException(reason);
24+
} else {
25+
try {
26+
throw new Error('Unhandled Promise error detected');
27+
} catch (err) {
28+
Raven.captureException(err, {extra: {reason: reason}});
29+
}
30+
}
2331
});
2432

2533
}(window, window.Raven, window.Ember));

0 commit comments

Comments
 (0)