Twisted chainDeferred not working as expected
- by Martin Gergov
I have a problem figuring out a somewhat simple twisted python code.
From what I have red in the docs, the code here should work without Unhandled Error.
I get this:
HELLO!
HANDLED!
HANDLED 2!
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
File "package_tester.py", line 31, in <module>
a().callback(2)
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 368, in callback
self._startRunCallbacks(result)
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 551, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "package_tester.py", line 5, in c
raise Exception()
exceptions.Exception:
Isn't the failure from the chained deferred passed to end() errback ?