Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #29 from zooniverse/reject-with-error
Browse files Browse the repository at this point in the history
Reject with the error if there's no response
  • Loading branch information
parrish committed May 4, 2016
2 parents 91abd6a + 87af446 commit 7f4721a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/make-http-request.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ makeHTTPRequest = (method, url, data, headers = {}, modify) ->
if error?.status is 408
resolve makeHTTPRequest.apply null, originalArguments
else if error?
reject response
# Prefer rejecting with the response, since it'll have more specific information.
# TODO: Reject with the error as expected and access the response through `error.response` in the handler.
reject response ? error
else
resolve response

Expand Down

0 comments on commit 7f4721a

Please sign in to comment.