[Twisted-Python] t.w.client.Agent exceptions
All, I'm having a head-poundingly annoying time getting detailed exception info out of the new Agent stuff. Specifically, I have some bug inside my code somewhere, but I can't get decent tracebacks out because _WrapperException is the base class for RequestGenerationFailed, but there's no public (non-underscore-prefixed) way to get that. It seems like an API error; how is one supposed to err.track/check other than importing a non-public API?
On Mar 5, 2014, at 9:23 AM, Phil Mayers
All,
I'm having a head-poundingly annoying time getting detailed exception info out of the new Agent stuff.
Specifically, I have some bug inside my code somewhere, but I can't get decent tracebacks out because _WrapperException is the base class for RequestGenerationFailed, but there's no public (non-underscore-prefixed) way to get that.
It seems like an API error; how is one supposed to err.track/check other than importing a non-public API?
You're right; this is a bug in Agent. http://twistedmatrix.com/trac/ticket/5310 For right now, yes, you're going to have to import some crappy private APIs. Any chance I could convince you to submit some fixes to that ticket so we won't have to do that in the future? :-) -glyph
On 05/03/2014 22:08, Glyph Lefkowitz wrote:
You're right; this is a bug in Agent.
And it must be said, really quite an infuriating one ;o)
For right now, yes, you're going to have to import some crappy private APIs. Any chance I could convince you to submit some fixes to that ticket so we won't have to do that in the future? :-)
I'll have a look tomorrow; though it seems like testing that would be tricky, and pointers to existing examples of how to test that Failure-with-traceback is being raised? Do we know what the rationale for _WrapperException was? The only place it's used, it wraps a single exception, which is "singularly" pointless (ha ha marvel at my comedy).
On 5 Mar, 10:49 pm, p.mayers@imperial.ac.uk wrote:
On 05/03/2014 22:08, Glyph Lefkowitz wrote:
You're right; this is a bug in Agent.
And it must be said, really quite an infuriating one ;o)
For right now, yes, you're going to have to import some crappy private APIs. Any chance I could convince you to submit some fixes to that ticket so we won't have to do that in the future? :-)
I'll have a look tomorrow; though it seems like testing that would be tricky, and pointers to existing examples of how to test that Failure- with- traceback is being raised?
Do we know what the rationale for _WrapperException was? The only place it's used, it wraps a single exception, which is "singularly" pointless (ha ha marvel at my comedy).
I think you overlooked some of its uses. For example, ResponseFailed is a _WrapperException subclass and it is constructed with two failures in HTTP11ClientProtocol.connectionLost. Jean-Paul
On 10:08 pm, glyph@twistedmatrix.com wrote:
On Mar 5, 2014, at 9:23 AM, Phil Mayers
wrote: All,
I'm having a head-poundingly annoying time getting detailed exception info out of the new Agent stuff.
Specifically, I have some bug inside my code somewhere, but I can't get decent tracebacks out because _WrapperException is the base class for RequestGenerationFailed, but there's no public (non-underscore- prefixed) way to get that.
It seems like an API error; how is one supposed to err.track/check other than importing a non-public API?
You're right; this is a bug in Agent.
Happy Ash Wednesday - https://twistedmatrix.com/trac/ticket/5310#comment:5 Jean-Paul
On Mar 5, 2014, at 3:01 PM, exarkun@twistedmatrix.com wrote:
On 10:08 pm, glyph@twistedmatrix.com wrote:
On Mar 5, 2014, at 9:23 AM, Phil Mayers
wrote: All,
I'm having a head-poundingly annoying time getting detailed exception info out of the new Agent stuff.
Specifically, I have some bug inside my code somewhere, but I can't get decent tracebacks out because _WrapperException is the base class for RequestGenerationFailed, but there's no public (non-underscore- prefixed) way to get that.
It seems like an API error; how is one supposed to err.track/check other than importing a non-public API?
You're right; this is a bug in Agent.
Happy Ash Wednesday - https://twistedmatrix.com/trac/ticket/5310#comment:5
I've reviewed it, so, at least the public alias part should be fixed soon :). -glyph
participants (3)
-
exarkun@twistedmatrix.com
-
Glyph Lefkowitz
-
Phil Mayers