Skip to content

Commit

Permalink
Check for RequestException
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Apr 3, 2024
1 parent 2405709 commit 4244d68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/charms/opensearch/v0/opensearch_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def call(url: str) -> requests.Response:
if resp_status_code:
return resp.status_code
except (requests.RequestException, urllib3.exceptions.HTTPError) as e:
if not isinstance(e, requests.HTTPError):
if not isinstance(e, requests.RequestException) or e.response is None:
raise OpenSearchHttpError(response_text=str(e))

if resp_status_code:
Expand Down

0 comments on commit 4244d68

Please sign in to comment.