[Twisted-Python] How to show traceback of "Unhandled error"?

Shiyao MA i at introo.me
Fri May 18 02:56:34 MDT 2018


Hi,

Running the following script prints "Unhandled Error", but doesn't
contain the traceback of where the exception is raised.  In a massive
codebase, it's hard to locate where is the malfunctioning code is.


from twisted.internet.defer import Deferred

def raiseErr(what):
    raise Exception(what)

d = Deferred()
d.addCallback(raiseErr)
d.callback("asdf")

# how to show the traceback without manually adding an errback at the end?
# adding at the *end* of a deferred is hard as we don't know when the
client stops adding callbacks.




-- 
Best,
Shiyao



More information about the Twisted-Python mailing list