| Home | Trees | Indices | Help |
|
|---|
|
|
A basic abstraction for an error that has occurred.
This is necessary because Python's built-in error mechanisms are inconvenient for asynchronous communication.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
pickled = 0
|
|||
stack = None
|
|||
_yieldOpcode =
|
|||
__implemented__ = <implementedBy twisted.python.failure.Failure>
|
|||
__provides__ = <zope.interface.declarations.ClassProvides obje
|
|||
|
|||
|
type The exception's class. |
|||
|
value The exception instance responsible for this failure. |
|||
|
|||
Initialize me with an explanation of the error. By default, this will use the current If no For |
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.
|
Check if this failure's type is in a predetermined list.
|
Throw the original exception into the given generator, preserving traceback information if available.
|
Get an object that represents this Failure's stack that can be passed to traceback.extract_tb. If the original traceback object is still present, return that. If
this traceback object has been lost but we still have the information,
return a fake traceback object (see |
|
|||
__provides__
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Mar 25 21:38:27 2010 | http://epydoc.sourceforge.net |