From ebe0dd73e28b6e2e874faa1785fe200ac810ded0 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 1 Nov 2023 16:36:51 +0100 Subject: [PATCH] handle case when response does not have original respose --- ayon_api/server_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ayon_api/server_api.py b/ayon_api/server_api.py index 733c0eb6e..9c521b40b 100644 --- a/ayon_api/server_api.py +++ b/ayon_api/server_api.py @@ -176,6 +176,11 @@ def status_code(self): return self.status def raise_for_status(self, message=None): + if self._response is None: + if self._data and self._data.get("detail"): + raise ServerError(self._data["detail"]) + raise ValueError("Response is not available.") + try: self._response.raise_for_status() except requests.exceptions.HTTPError as exc: