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

Wrap non-JSON responses in json error response #63

Draft
wants to merge 1 commit into
base: v4.x
Choose a base branch
from

Conversation

chadicus
Copy link
Contributor

@chadicus chadicus commented Jan 9, 2025

What does this PR do?

This pull request updates the GuzzleAdapter to check the HTTP response for valid JSON. Before if the response was not valid json an exception was thrown. This change will intercept the non-JSON response and return an error formatted json response containing the original non-JSON response. This will maintain the original returned API status code as well

Checklist

  • Pull request contains a clear definition of changes
  • Tests (either unit, integration, or acceptance) written and passing
  • Relevant documentation produced and/or updated

Copy link
Contributor

@chrisryan chrisryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense. We should tag this as a potentially backwards breaking change. It also looks like the builds may need to be updated.

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