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

Throw a TransportException when an error response cannot be parsed #579

Merged
merged 1 commit into from May 23, 2023

Conversation

swallez
Copy link
Member

@swallez swallez commented May 23, 2023

When an error response cannot be parsed, make sure we throw a TransportException that wraps the original response for further inspection. This is useful when a request fails because a proxy rejected the response and returns its own error response which can be anything.

Also add status code to TransportException.

Fixes #563

@swallez swallez merged commit 9246eab into main May 23, 2023
7 of 8 checks passed
@swallez swallez deleted the fix-non-json-error-parsing branch May 23, 2023 12:53
swallez added a commit that referenced this pull request May 23, 2023
) (#580)

Co-authored-by: Sylvain Wallez <sylvain@elastic.co>
swallez added a commit that referenced this pull request May 23, 2023
) (#581)

Co-authored-by: Sylvain Wallez <sylvain@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

401 Unauthorized exception marked as JsonParsingException
1 participant