Skip to content

Commit

Permalink
fix: OrganizationHttpError did not get correct status code
Browse files Browse the repository at this point in the history
Signed-off-by: Guilhem Barthés <guilhem.barthes@owkin.com>
  • Loading branch information
guilhem-barthes committed Aug 22, 2024
1 parent e660788 commit de0b8a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/substrapp/clients/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ def _http_request(

try:
response.raise_for_status()
except requests.exceptions.HTTPError as exc:
status_code = response.status_code if exc.response else None
raise OrganizationHttpError(url=url, status_code=status_code)
except requests.exceptions.HTTPError:
raise OrganizationHttpError(url=url, status_code=response.status_code)

return response

Expand Down

0 comments on commit de0b8a4

Please sign in to comment.