Double tracebacks for t.web & klein

Phil Mayers <[email protected]> Mon, 16 Sep 2013 17:58:15 +0100
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
I'm playing with klein for a simple rest API (because I like the 
routing, mainly).

When a method raises an exception, a traceback gets logged twice - once 
by the t.web Request.processingFailed, called from here:

https://github.com/twisted/klein/blob/master/klein/resource.py#L125

...and once by the deferred garbage collection, as 
Request.processingFailed doesn't eat the deferred:

http://twistedmatrix.com/trac/browser/tags/releases/twisted-13.1.0/twisted/web/server.py#L314

Obviously this double-traceback thing is hugely irritating. Who is at 
fault here? Is t.web doing the right thing by returning the failure from 
processingFailed, or is klein doing the wrong thing, either by using the 
(undocumented) processingFailed or omitting an errback further down the 
chain?

Obviously there's no way for *me* to add an errback - klein generates 
the deferred for me.