Skip to content

Conversation

@adev-code
Copy link
Contributor

@adev-code adev-code commented Jul 1, 2025

Services sometimes return generic HTML error responses instead of their modeled protocol format, and this may also occur when requests pass through proxies. Currently, botocore handles this gracefully for 5XX errors by detecting and processing these generic responses appropriately. However, 4XX errors are not handled the same way. For example, in corner cases where the input to a request is too large (HTTP 413) or otherwise invalid, some AWS services may respond with a generic HTTP response instead of their service's modeled protocol. This change extends the same handling to 4XX errors, ensuring customers receive informative error messages for both 4XX and 5XX generic responses, rather than unhelpful parsing errors.

@SamRemis
Copy link
Contributor

SamRemis commented Jul 1, 2025

Thanks for the PR, it's a good start. Still a few things we are going to have to do here prior to merging:

  1. Add a test to make sure this behavior is working as expected
  2. Investigate the test failures in the CI to make sure we aren't adding any breaking changes
  3. Add some more context to the PR description to make it clear what types of cases this will happen in.

I'm happy to help with or elaborate on any/all of the above

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