Skip to content

Commit

Permalink
Merge branch '30-implement-the-interface-for-the-secrets' of https://…
Browse files Browse the repository at this point in the history
…github.com/jupyter-naas/naas-python into 30-implement-the-interface-for-the-secrets
  • Loading branch information
l-loic committed Feb 26, 2024
2 parents 29143ff + d99f855 commit d06b5f2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions naas_python/utils/domains_base/secondary/BaseAPIAdaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def make_api_request(
return api_response

except requests.exceptions.HTTPError as e:
_response = api_response.json()
if api_response.status_code == 401:
_response = api_response.json()
_message = ""
if "error_message" in _response:
_message = _response["error_message"]
Expand All @@ -103,13 +103,7 @@ def make_api_request(
e,
)
elif api_response.status_code == 500:
_message = ""
if "error_message" in _response:
_message = _response["error_message"]
elif "detail" in _response:
_message = _response["detail"]
else:
_message = "Internal Server Error"
_message = "Internal Server Error"
raise ServiceStatusError(_message, e)
else:
# Other status codes will be handled by the calling method
Expand Down

0 comments on commit d06b5f2

Please sign in to comment.