Skip to content

Commit

Permalink
handle case when response does not have original respose
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Nov 1, 2023
1 parent d4894b4 commit ebe0dd7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ayon_api/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ebe0dd7

Please sign in to comment.