Skip to content
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

pass msg body to the error #2339

Conversation

fin-dogedev
Copy link

@fin-dogedev fin-dogedev commented Mar 14, 2024

This PR addresses an issue where the server response is obscured when encountering a 400 status code. My colleague and I encountered difficulties due to the library's behavior of hiding the server response in such cases. This situation is particularly problematic as some servers provide valuable error messages within the response body for 400 status codes.

The changes included in this PR aim to enhance the handling of 400 response status codes by ensuring that the server response is properly surfaced and accessible to users. By exposing the full server response, we can better diagnose and address issues encountered during API interactions, leading to improved usability and developer experience.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.
  • If it's a new feature, I have included documentation updates in both the README and the types.

@sindresorhus
Copy link
Owner

This is intentional. We could maybe make it opt-in with an option for now.

#1126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants