Skip to content

Commit bbaf967

Browse files
committed
feat: handle head response
1 parent 7d4a8ef commit bbaf967

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyiceberg/catalog/rest/response.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def _handle_non_200_response(exc: HTTPError, error_handler: dict[int, type[Excep
9898
if uri := error.error_uri:
9999
response += f" ({uri})"
100100
else:
101+
# Handle empty response bodies (Specifically HEAD requests via exist requests)
102+
if not exc.response.text:
103+
response = f"{exception.__name__}: {exc.response.reason}"
104+
raise exception(response) from exc
105+
101106
error = ErrorResponse.model_validate_json(exc.response.text).error
102107
response = f"{error.type}: {error.message}"
103108
except JSONDecodeError:

0 commit comments

Comments
 (0)