botocore
botocore copied to clipboard
Return generic error response for errors with non-xml bodies
Some proxies may return a custom response in the HTTP body when encountering an error response such as an HTTP/503.
Currently we assume that any error response with a body that does not begin with "" is XML which can lead to unhandled ResponseParserError errors on proxies with custom body responses for things like a transient timeout.
Lets expand what we consider a "generic" error to include responses whose body is not XML by ensuring it must start with a leading "<". ` The other implementation option is to handle ResponseParserErrors in botocore.parsers.QueryParser._do_error_parse and return _do_generic_error_parse instead which I'd be happy to implement instead of preferred