summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-05-22 11:39:20 +0100
committerGitHub <noreply@github.com>2020-05-22 11:39:20 +0100
commit547e4dd83e7d70c30ce8b40578d0750fc10373fa (patch)
tree84fe85f71ea6e9c5e0794a4659eb8b10ee58733f /synapse/handlers/federation.py
parentsynapse.metrics: implement detailed memory usage reporting on PyPy (#7536) (diff)
downloadsynapse-547e4dd83e7d70c30ce8b40578d0750fc10373fa.tar.xz
Fix exception reporting due to HTTP request errors. (#7556)
These are business as usual errors, rather than stuff we want to log at
error.
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 81d859f807..bb03cc9add 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -40,6 +40,7 @@ from synapse.api.errors import (
     Codes,
     FederationDeniedError,
     FederationError,
+    HttpResponseException,
     RequestSendFailed,
     SynapseError,
 )
@@ -1038,6 +1039,12 @@ class FederationHandler(BaseHandler):
                 except SynapseError as e:
                     logger.info("Failed to backfill from %s because %s", dom, e)
                     continue
+                except HttpResponseException as e:
+                    if 400 <= e.code < 500:
+                        raise e.to_synapse_error()
+
+                    logger.info("Failed to backfill from %s because %s", dom, e)
+                    continue
                 except CodeMessageException as e:
                     if 400 <= e.code < 500:
                         raise