-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server response body is swallowed if code is not OK #234
Comments
@happycollision How does that look? In your example, the console output would be:
|
That works for me just fine. But are there scenarios where the server might not be sending JSON? Perhaps the error messages will be in plain text, etc. That discussion is up to you and your fellow collaborators. In any case, thanks for that amazingly fast response! |
Yeah, I thought about. It was kind of messy so I figured it wasn't worth it but you are right. I added support for both: 32568ba JSON response:
Text response:
|
Nice! |
Pretty sure this was introduced at commit 7558b36
Since v4.0.0, if a server responds with something like this (with a non-ok response code):
The errors array disappears and the only thing available in the
catch
block of the call toauthenticate()
is a vanilla error wheremessage
is "Unauthorized".Given the following:
3.x console:
Post 4.0.0 console:
The text was updated successfully, but these errors were encountered: