Skip to content

Commit

Permalink
Explicitely catch requests ConnectionError
Browse files Browse the repository at this point in the history
and don't overwrite built-in ConnectionError with import statement.
  • Loading branch information
JOJ0 committed Jan 31, 2025
1 parent 252d599 commit 4bb093d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions synadm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import traceback

import requests
from requests.exceptions import ConnectionError


def log_fatal_exit(error, logger, message=None):
Expand Down Expand Up @@ -172,7 +171,7 @@ def query(
self.log.warning(f"{host_descr} returned status code "
f"{resp.status_code}")
return resp.json()
except ConnectionError as error:
except requests.exceptions.ConnectionError as error:
log_fatal_exit(error, self.log, "Connection error. Please check "
"that Synapse can be reached.")
except Exception as error:
Expand Down

0 comments on commit 4bb093d

Please sign in to comment.