[Twisted-Python] A question about errorback failure objects

When an errorback gets called with a failure parameter what is the best way to get the stack trace (to see what lines at what files caused the error)?

On Wed, 24 Sep 2008 14:47:02 +0200, Vasil Vangelovski <vvangelovski@gmail.com> wrote:
When an errorback gets called with a failure parameter what is the best way to get the stack trace (to see what lines at what files caused the error)?
You can find the API documentation for failures here: http://twistedmatrix.com/documents/current/api/twisted.python.failure.Failur... You might be interested in the printTraceback method. You can also pass a failure to twisted.python.log.err and a traceback will be written. Keep in mind, however, that not all failures have tracebacks. If you try printing a failure's traceback and don't see anything interesting, this may be because the failure wasn't created with a traceback. In this case, running with failure debugging enabled (eg, with twistd --debug) may provide more useful information, since it will set a breakpoint on failure creation, letting you inspect the creation context. Jean-Paul
participants (2)
-
Jean-Paul Calderone
-
Vasil Vangelovski