Skip to content

Commit

Permalink
Merge pull request JakeChampion#306 from github/timeout-reject
Browse files Browse the repository at this point in the history
Reject promise on request timeout
  • Loading branch information
dgraham committed Apr 2, 2016
2 parents c23c3f9 + 619ee08 commit 4dbbfd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@
reject(new TypeError('Network request failed'))
}

xhr.ontimeout = function() {
reject(new TypeError('Network request failed'))
}

xhr.open(request.method, request.url, true)

if (request.credentials === 'include') {
Expand Down

0 comments on commit 4dbbfd0

Please sign in to comment.