You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't get error response in catch block... I just get Unexpected end of JSON input
I want to handle 404 , 400, 500
This may not be issue... It is something I am facing.
The text was updated successfully, but these errors were encountered:
gillchristian
changed the title
How can i fetch error response like(404, 400) it does not come in catch block
How to handle error response with failure status?
Aug 7, 2019
@AnshulM34 thanks for reporting. I formatted a bit your message, added syntax highlighting. I suggest you keep that in mind when opening and issue, it things easier to understand for us maintainers.
It's a bit hard to reproduce your issue because we lack the context. If you would provide and example in Codesandbox.
That said, I have a guess of what's causing your issue. We also parse the response when there's an error. Seeing "Unexpected end of JSON input" we are using the json parser when we shouldn't. At the moment I'm not sure if that could be changed, but we'll improve it for sure on the v2
Below is something I tried using
I don't get error response in
catch
block... I just getUnexpected end of JSON input
I want to handle 404 , 400, 500
This may not be issue... It is something I am facing.
The text was updated successfully, but these errors were encountered: