summary refs log tree commit diff
path: root/synapse/http/__init__.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-09-29 14:21:41 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-09-29 14:21:41 +0100
commitf43c66d23b5639706bf5aca36ac5089311fac196 (patch)
tree37b68842bc8c607262c3875f9ecf2cef75e63c4c /synapse/http/__init__.py
parentChangelog (diff)
parentAdd support for running Complement against the local checkout (#8317) (diff)
downloadsynapse-f43c66d23b5639706bf5aca36ac5089311fac196.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/info-mainline-no-check-password-reset
Diffstat (limited to 'synapse/http/__init__.py')
-rw-r--r--synapse/http/__init__.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/synapse/http/__init__.py b/synapse/http/__init__.py
index 8eb3638591..59b01b812c 100644
--- a/synapse/http/__init__.py
+++ b/synapse/http/__init__.py
@@ -16,8 +16,6 @@
 import re
 
 from twisted.internet import task
-from twisted.internet.defer import CancelledError
-from twisted.python import failure
 from twisted.web.client import FileBodyProducer
 
 from synapse.api.errors import SynapseError
@@ -26,19 +24,8 @@ from synapse.api.errors import SynapseError
 class RequestTimedOutError(SynapseError):
     """Exception representing timeout of an outbound request"""
 
-    def __init__(self):
-        super().__init__(504, "Timed out")
-
-
-def cancelled_to_request_timed_out_error(value, timeout):
-    """Turns CancelledErrors into RequestTimedOutErrors.
-
-    For use with async.add_timeout_to_deferred
-    """
-    if isinstance(value, failure.Failure):
-        value.trap(CancelledError)
-        raise RequestTimedOutError()
-    return value
+    def __init__(self, msg):
+        super().__init__(504, msg)
 
 
 ACCESS_TOKEN_RE = re.compile(r"(\?.*access(_|%5[Ff])token=)[^&]*(.*)$")