diff --git a/ayon_api/utils.py b/ayon_api/utils.py index 49917c7bb..1e6837e90 100644 --- a/ayon_api/utils.py +++ b/ayon_api/utils.py @@ -178,6 +178,16 @@ def raise_for_status(self, message=None): except requests.exceptions.HTTPError as exc: if message is None: message = str(exc) + + # Get 'detail' from response.json() if possible because it'll be + # more descriptive than default http error message + try: + detail = exc.response.json()["detail"] + if detail: + message = f"{message} ({detail})" + except (AttributeError, KeyError, RequestsJSONDecodeError): + pass + raise HTTPRequestError(message, exc.response) def __enter__(self, *args, **kwargs):