mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-04 22:30:52 -05: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):
|
def errback(f):
|
||||||
object.__setattr__(self, "_result", (False, f))
|
object.__setattr__(self, "_result", (False, f))
|
||||||
while self._observers:
|
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:
|
try:
|
||||||
# TODO: Handle errors here.
|
# TODO: Handle errors here.
|
||||||
self._observers.pop().errback(f)
|
self._observers.pop().errback(f)
|
||||||
|
Loading…
Reference in New Issue
Block a user