Skip to content

Commit 7612d8a

Browse files
committed
follow style from neighboring code
1 parent bbaf967 commit 7612d8a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pyiceberg/catalog/rest/response.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,9 @@ def _handle_non_200_response(exc: HTTPError, error_handler: dict[int, type[Excep
101101
# Handle empty response bodies (Specifically HEAD requests via exist requests)
102102
if not exc.response.text:
103103
response = f"{exception.__name__}: {exc.response.reason}"
104-
raise exception(response) from exc
105-
106-
error = ErrorResponse.model_validate_json(exc.response.text).error
107-
response = f"{error.type}: {error.message}"
104+
else:
105+
error = ErrorResponse.model_validate_json(exc.response.text).error
106+
response = f"{error.type}: {error.message}"
108107
except JSONDecodeError:
109108
# In the case we don't have a proper response
110109
response = f"RESTError {exc.response.status_code}: Could not decode json payload: {exc.response.text}"

0 commit comments

Comments
 (0)