Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Twisted Failure object has everything you need. For getting nice traceback try using <strong>printTraceback()</strong> method:</p> <pre><code>&gt;&gt;&gt; from twisted.internet.defer import Deferred as D &gt;&gt;&gt; def start_app(_): ... #import os ... return os.startfile('sasa') ... ... def command_die(err): ... err.printTraceback() ... ... ... d = D() ... d.addCallback(start_app) ... d.addErrback(command_die) ... d.callback(0) Traceback (most recent call last): File "C:\Users\Pilyavskiy\AppData\Local\DreamPie\share\dreampie\subp-py2\dreampielib\subprocess\__init__.py", line 324, in execute exec codeob in self.locs File "&lt;pyshell#3&gt;", line 12, in &lt;module&gt; d.callback(0) File "C:\pill\Python27\lib\site-packages\twisted\internet\defer.py", line 361, in callback self._startRunCallbacks(result) File "C:\pill\Python27\lib\site-packages\twisted\internet\defer.py", line 455, in _startRunCallbacks self._runCallbacks() --- &lt;exception caught here&gt; --- File "C:\pill\Python27\lib\site-packages\twisted\internet\defer.py", line 542, in _runCallbacks current.result = callback(current.result, *args, **kw) File "&lt;pyshell#3&gt;", line 3, in start_app return os.startfile('sasa') exceptions.NameError: global name 'os' is not defined </code></pre> <p>Look for other options in source <a href="http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/python/failure.py#L121" rel="nofollow">http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/python/failure.py#L121</a> it's pretty well commented.</p> <p>PS: Name <strong>d</strong> is mostly used for deferred itself, for <strong>result/error</strong> it's better to use something like <strong>res/err</strong> etc</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload