geruh commented on code in PR #3041:
URL: https://github.com/apache/iceberg-python/pull/3041#discussion_r2806304878
##########
pyiceberg/catalog/rest/response.py:
##########
@@ -98,8 +98,12 @@ def _handle_non_200_response(exc: HTTPError, error_handler:
dict[int, type[Excep
if uri := error.error_uri:
response += f" ({uri})"
else:
- error = ErrorResponse.model_validate_json(exc.response.text).error
- response = f"{error.type}: {error.message}"
+ # Handle empty response bodies (Specifically HEAD requests via
exist requests)
+ if not exc.response.text:
+ response = f"{exception.__name__}: {exc.response.reason}"
Review Comment:
Nit: the `exc.response.reason` can be None
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]