mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fix stacktraces when using ObservableDeferred and async/await (#6836)
This commit is contained in:
parent
370080531e
commit
ae5b3104f0
1
changelog.d/6836.misc
Normal file
1
changelog.d/6836.misc
Normal file
@ -0,0 +1 @@
|
||||
Fix stacktraces when using `ObservableDeferred` and async/await.
|
@ -73,6 +73,10 @@ class ObservableDeferred(object):
|
||||
def errback(f):
|
||||
object.__setattr__(self, "_result", (False, f))
|
||||
while self._observers:
|
||||
# This is a little bit of magic to correctly propagate stack
|
||||
# traces when we `await` on one of the observer deferreds.
|
||||
f.value.__failure__ = f
|
||||
|
||||
try:
|
||||
# TODO: Handle errors here.
|
||||
self._observers.pop().errback(f)
|
||||
|
Loading…
Reference in New Issue
Block a user