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
pull/749/head
lilia 10 years ago
parent a32f3ff1f6
commit 1345899253

@ -39305,7 +39305,7 @@ MessageReceiver.prototype = {
ev.error = error;
ev.proto = envelope;
this.dispatchEvent(ev);
throw error; // reject this promise
return Promise.reject(error);
}.bind(this));
},
handleSentMessage: function(destination, timestamp, message) {

@ -111,7 +111,7 @@ MessageReceiver.prototype = {
ev.error = error;
ev.proto = envelope;
this.dispatchEvent(ev);
throw error; // reject this promise
return Promise.reject(error);
}.bind(this));
},
handleSentMessage: function(destination, timestamp, message) {

Loading…
Cancel
Save