diff options
author | Erik Johnston <erik@matrix.org> | 2016-12-09 16:30:29 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-12-09 16:30:29 +0000 |
commit | fbaf868f621c2ecb6ea10679eb435f9adffa3b2a (patch) | |
tree | ddd0c34d774583c2234c8c669e845d379fb4b0f1 /synapse/util | |
parent | Fix rare notifier bug where listeners dont timeout (diff) | |
download | synapse-fbaf868f621c2ecb6ea10679eb435f9adffa3b2a.tar.xz |
Correctly handle timeout errors
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py index c05b9450be..30fc480108 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py @@ -24,6 +24,11 @@ import logging logger = logging.getLogger(__name__) +class DeferredTimedOutError(SynapseError): + def __init__(self): + super(SynapseError).__init__(504, "Timed out") + + def unwrapFirstError(failure): # defer.gatherResults and DeferredLists wrap failures. failure.trap(defer.FirstError) @@ -89,7 +94,7 @@ class Clock(object): def timed_out_fn(): try: - ret_deferred.errback(SynapseError(504, "Timed out")) + ret_deferred.errback(DeferredTimedOutError()) except: pass |