diff --git a/pyiceberg/catalog/rest.py b/pyiceberg/catalog/rest.py index ad2c510d03..20875d313d 100644 --- a/pyiceberg/catalog/rest.py +++ b/pyiceberg/catalog/rest.py @@ -319,6 +319,10 @@ def _split_identifier_for_json(self, identifier: Union[str, Identifier]) -> Dict def _handle_non_200_response(self, exc: HTTPError, error_handler: Dict[int, Type[Exception]]) -> None: exception: Type[Exception] + + if exc.response is None: + raise ValueError("Did not receive a response") + code = exc.response.status_code if code in error_handler: exception = error_handler[code]