Skip to content

Commit

Permalink
Fixes #8 - Report error messages in XHR.statusText.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbordet committed Jul 4, 2017
1 parent 55bc621 commit 93a21a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cometd-nodejs-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ module.exports = {
['abort', 'aborted', 'error'].forEach(function(event) {
_request.on(event, function(x) {
self.readyState = window.XMLHttpRequest.DONE;
var error = x.message;
if (error) {
self.statusText = error;
}
if (self.onerror) {
self.onerror(x);
}
Expand Down

0 comments on commit 93a21a7

Please sign in to comment.