Currently in case of error status >= 400, the promise is rejected with a response object that was already transformed code. It should instead pass the transformed object (data) in this case.
For example, here's the actual error message for a request that went wrong:
{"status":403,"message":"User doesn't have write permission."}
Currently in case of error status >= 400, the promise is rejected with a response object that was already transformed code. It should instead pass the transformed object (
data
) in this case.For example, here's the actual error message for a request that went wrong:
And here is the error that was caught:
This makes error handling tricky.
Steps to replicate