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

[0.5]: unify exception handling #113

Merged
merged 1 commit into from
May 1, 2023
Merged

Conversation

gehrisandro
Copy link
Collaborator

This PR unifies the exception handling between the different request types and HTTP client implementations:

  • stream requests are now checked for a json response error and throws the corresponding ErrorException like object or content requests already do.
  • Guzzle ClientExceptions are checked for json errors before throwing the TransporterException and throw a ErrorException instead.
    Background: For client errors (4xx) the API returns a json error but this wasn't handled with the Guzzle Client yet because Guzzle throws an exception instead of returning the response like the other HTTP clients do.

This change from TransporterException to ErrorException for 4xx responses with the Guzzle Client is a (minor) breaking change!

This resolves #90

@nunomaduro nunomaduro merged commit 063a448 into main May 1, 2023
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.

2 participants