Skip to content

Commit

Permalink
Merge pull request #11 from lteacher/fix-error-message
Browse files Browse the repository at this point in the history
Fix an issue where response is not in err
  • Loading branch information
lteacher authored Aug 16, 2017
2 parents 666149c + 3835410 commit 5db33e7
Show file tree
Hide file tree
Showing 4 changed files with 2,003 additions and 994 deletions.
6 changes: 5 additions & 1 deletion index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ fx.request = (req, route, checkAccount = true) ->
# Need to remove them from here and also from the subscribe below
return deferred
?.then ({status, headers, data}) -> assign {}, {status, headers}, data
?.catch ({response}) ->
?.catch (err) ->
# If no response param then return the whole error
unless err?.response?.status then return Promise.reject err

{response} = err
{status, headers, data} = response
Promise.reject assign {}, {status, headers}, data

Expand Down
Loading

0 comments on commit 5db33e7

Please sign in to comment.