summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-18 10:50:10 +0000
committerErik Johnston <erik@matrix.org>2015-02-18 10:50:10 +0000
commit5e2447146982a30d0d4ea1334297cc0bfb32c3c5 (patch)
tree801d66d0e93b9558aff8e65a3eba0492db6f3ff6 /synapse
parentFix pyflakes (diff)
downloadsynapse-5e2447146982a30d0d4ea1334297cc0bfb32c3c5.tar.xz
Fix up ResponseNeverReceived to str
Diffstat (limited to 'synapse')
-rw-r--r--synapse/http/matrixfederationclient.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index b5e201b5f1..304efcdd56 100644
--- a/synapse/http/matrixfederationclient.py
+++ b/synapse/http/matrixfederationclient.py
@@ -146,21 +146,13 @@ class MatrixFederationHttpClient(object):
                     )
                     raise SynapseError(400, "Domain specified not found.")
 
-                if hasattr(e, "reasons"):
-                    reasons = ", ".join(
-                        str(f.value.message)
-                        for f in e.reasons
-                    )
-                else:
-                    reasons = e.message
-
                 logger.warn(
                     "Sending request failed to %s: %s %s: %s - %s",
                     destination,
                     method,
                     url_bytes,
                     type(e). __name__,
-                    reasons,
+                    _flatten_response_never_received(e),
                 )
 
                 if retries_left:
@@ -474,3 +466,13 @@ class _JsonProducer(object):
 
     def stopProducing(self):
         pass
+
+
+def _flatten_response_never_received(e):
+    if hasattr(e, "reasons"):
+        return ", ".join(
+            _flatten_response_never_received(f.value)
+            for f in e.reasons
+        )
+    else:
+        return "%s: %s" % (type(e), e.message,)