Home | Trees | Index | Help |
|
---|
Package twisted :: Package python :: Module failure :: Class Failure |
|
CopiedFailure
,
CopyableFailure
A basic abstraction for an error that has occurred.
This is necessary because Python's built-in error mechanisms are inconvenient for asynchronous communication.Method Summary | |
---|---|
Initialize me with an explanation of the error. | |
Avoid pickling objects in the traceback. | |
__repr__(self)
| |
__str__(self)
| |
check(self,
*errorTypes)
| |
Remove references to other objects, replacing them with strings. | |
getBriefTraceback(self)
| |
Get a string of the exception which caused this Failure. | |
getTraceback(self)
| |
Print a traceback as densely as possible. | |
Print a traceback with detailed locals and globals information. | |
Emulate Python's standard error reporting mechanism. | |
Trap this failure if its type is in a predetermined list. |
Instance Variable Summary | |
---|---|
type : The exception's class. | |
value : The exception instance responsible for this failure. |
Class Variable Summary | |
---|---|
int |
pickled = 0 |
NoneType |
stack = None |
Method Details |
---|
__getstate__(self)Avoid pickling objects in the traceback. |
cleanFailure(self)Remove references to other objects, replacing them with strings. |
getErrorMessage(self)Get a string of the exception which caused this Failure. |
printBriefTraceback(self, file=None)Print a traceback as densely as possible. |
printDetailedTraceback(self, file=None)Print a traceback with detailed locals and globals information. |
printTraceback(self, file=None)Emulate Python's standard error reporting mechanism. |
trap(self, *errorTypes)Trap this failure if its type is in a predetermined list. This allows you to trap a Failure in an error callback. It will be automatically re-raised if it is not a type that you expect. The reason for having this particular API is because it's very useful in Deferred errback chains: | def _ebFoo(self, failure): | r = failure.trap(Spam, Eggs) | print 'The Failure is due to either Spam or Eggs!' | if r == Spam: | print 'Spam did it!' | elif r == Eggs: | print 'Eggs did it!' If the failure is not a Spam or an Eggs, then the Failure will be 'passed on' to the next errback.
|
Instance Variable Details |
---|
typeThe exception's class. |
valueThe exception instance responsible for this failure. |
Class Variable Details |
---|
pickled
|
stack
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:10 2004 | http://epydoc.sf.net |