Skip to content

Commit

Permalink
fix: more reliably grab response code in error scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetazzoni committed Aug 9, 2024
1 parent ca19f93 commit 5a5ad5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sse.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var SSE = function (url, options) {

this._onStreamFailure = function(e) {
const event = new CustomEvent('error');
event.responseCode = this.xhr.status;
event.responseCode = e.currentTarget.status;
event.data = e.currentTarget.response;
this.dispatchEvent(event);
this._markClosed();
Expand Down

0 comments on commit 5a5ad5f

Please sign in to comment.