Skip to content

Commit

Permalink
Issue #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 93a21a7 commit f9c68fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cometd-nodejs-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ 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 (x) {
var error = x.message;
if (error) {
self.statusText = error;
}
}
if (self.onerror) {
self.onerror(x);
Expand Down

0 comments on commit f9c68fe

Please sign in to comment.