jiangxt2 opened a new issue, #14337: URL: https://github.com/apache/gravitino/issues/14337
### What would you like to be improved? The Python client's `HTTPClient` parses every nonempty HTTP error body as a Gravitino or OAuth2 JSON error response. An HTML error page, plain-text response, malformed JSON, or unexpected JSON structure can fail during decoding or validation before the client reports the original HTTP failure clearly. For example, a gateway response with HTTP 502 and an HTML body can surface as a JSON decoding error, obscuring the status and request context needed for diagnosis. Valid Gravitino and OAuth2 error responses already have domain exception handling, which should be preserved. ### How should we improve? - Preserve existing domain exceptions for valid structured error responses. - Handle empty, non-JSON, malformed, and unexpected error responses with a predictable SDK exception that retains the HTTP status, request method, and safe endpoint information. - Protect credentials and sensitive request data in diagnostic output; avoid unbounded response-body dumps. - Add regression coverage for structured errors and fallback handling. Automatic retries and changes to authentication behavior are outside this issue's scope. Parent epic: #14334. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
