diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-12 13:14:29 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-12 13:14:29 +0100 |
commit | 95dedb866f04ee4ae034c35130f2a8dc86243fbb (patch) | |
tree | 80080d23bffdfd8badb1d4b56cb4dc4884a61d4b /synapse/util | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/logging_co... (diff) | |
download | synapse-95dedb866f04ee4ae034c35130f2a8dc86243fbb.tar.xz |
Unwrap defer.gatherResults failures
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py index fd3eb1f574..c1a16b639a 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py @@ -23,6 +23,12 @@ import logging logger = logging.getLogger(__name__) +def unwrapFirstError(failure): + # defer.gatherResults and DeferredLists wrap failures. + failure.trap(defer.FirstError) + return failure.value.subFailure + + class Clock(object): """A small utility that obtains current time-of-day so that time may be mocked during unit-tests. |