Skip to content

Commit

Permalink
Merge pull request phoenixframework#1954 from korczis/master
Browse files Browse the repository at this point in the history
Fix accesing onerror(status) instead of onerror(resp && resp.status)
  • Loading branch information
chrismccord authored Oct 5, 2016
2 parents cf67130 + 64aad60 commit 0cefe23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion priv/static/phoenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ var LongPoll = exports.LongPoll = function () {

Ajax.request("POST", this.endpointURL(), "application/json", body, this.timeout, this.onerror.bind(this, "timeout"), function (resp) {
if (!resp || resp.status !== 200) {
_this9.onerror(status);
_this9.onerror(resp && resp.status);
_this9.closeAndRetry();
}
});
Expand Down
2 changes: 1 addition & 1 deletion web/static/js/phoenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ export class LongPoll {
send(body){
Ajax.request("POST", this.endpointURL(), "application/json", body, this.timeout, this.onerror.bind(this, "timeout"), (resp) => {
if(!resp || resp.status !== 200){
this.onerror(status)
this.onerror(resp && resp.status)
this.closeAndRetry()
}
})
Expand Down

0 comments on commit 0cefe23

Please sign in to comment.