diff options
author | Erik Johnston <erik@matrix.org> | 2021-07-15 10:35:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 10:35:46 +0100 |
commit | 7695ca06187bb6742ed74c5ae060c48a08af99ce (patch) | |
tree | 26282ea6de903cb27bcd2a586252df7ca6f4d79f /synapse/handlers/directory.py | |
parent | doc: Add delegation example to the caddy reverse proxy section (#10368) (diff) | |
download | synapse-7695ca06187bb6742ed74c5ae060c48a08af99ce.tar.xz |
Fix a number of logged errors caused by remote servers being down. (#10400)
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r-- | synapse/handlers/directory.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py index 4064a2b859..06d7012bac 100644 --- a/synapse/handlers/directory.py +++ b/synapse/handlers/directory.py @@ -22,6 +22,7 @@ from synapse.api.errors import ( CodeMessageException, Codes, NotFoundError, + RequestSendFailed, ShadowBanError, StoreError, SynapseError, @@ -252,12 +253,14 @@ class DirectoryHandler(BaseHandler): retry_on_dns_fail=False, ignore_backoff=True, ) + except RequestSendFailed: + raise SynapseError(502, "Failed to fetch alias") except CodeMessageException as e: logging.warning("Error retrieving alias") if e.code == 404: fed_result = None else: - raise + raise SynapseError(502, "Failed to fetch alias") if fed_result and "room_id" in fed_result and "servers" in fed_result: room_id = fed_result["room_id"] |