Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Ensure previous global handler called
Browse files Browse the repository at this point in the history
Fixes #63
  • Loading branch information
kattrali committed Jan 13, 2017
1 parent db281bb commit a3f6d25
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Bugsnag.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Client {

ErrorUtils.setGlobalHandler((error, isFatal) => {
if (this.config.autoNotify) {
this.notify(error, report => {report.severity = 'error'}, true, () => {
this.notify(error, report => {report.severity = 'error'}, !!NativeClient.notifyBlocking, () => {
if (previousHandler) {
previousHandler(error, isFatal);
}
Expand Down Expand Up @@ -91,10 +91,12 @@ export class Client {
beforeSendCallback(report);
}

if (NativeClient.notifyBlocking) {
NativeClient.notifyBlocking(report.toJSON(), blocking || false, postSendCallback);
if (blocking) {
NativeClient.notifyBlocking(report.toJSON(), blocking, postSendCallback);
} else {
NativeClient.notify(report.toJSON());
if (postSendCallback)
postSendCallback();
}
}

Expand Down

0 comments on commit a3f6d25

Please sign in to comment.