Use reject instead of throw
This ensures that the containing promise is rejected without triggering the side effects of an uncaught exception, such as causing the debugger to pause. // FREEBIE
This commit is contained in:
parent
a32f3ff1f6
commit
1345899253
2 changed files with 2 additions and 2 deletions
|
@ -39305,7 +39305,7 @@ MessageReceiver.prototype = {
|
||||||
ev.error = error;
|
ev.error = error;
|
||||||
ev.proto = envelope;
|
ev.proto = envelope;
|
||||||
this.dispatchEvent(ev);
|
this.dispatchEvent(ev);
|
||||||
throw error; // reject this promise
|
return Promise.reject(error);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
handleSentMessage: function(destination, timestamp, message) {
|
handleSentMessage: function(destination, timestamp, message) {
|
||||||
|
|
|
@ -111,7 +111,7 @@ MessageReceiver.prototype = {
|
||||||
ev.error = error;
|
ev.error = error;
|
||||||
ev.proto = envelope;
|
ev.proto = envelope;
|
||||||
this.dispatchEvent(ev);
|
this.dispatchEvent(ev);
|
||||||
throw error; // reject this promise
|
return Promise.reject(error);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
handleSentMessage: function(destination, timestamp, message) {
|
handleSentMessage: function(destination, timestamp, message) {
|
||||||
|
|
Loading…
Reference in a new issue