Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`python`.`failure``

module documentation
(source)

Asynchronous-friendly error mechanism.

See `Failure`.

Exception | `DefaultException` | Undocumented
Exception | `Failure` | A basic abstraction for an error that has occurred.
Exception | `NoCurrentExceptionError` | Raised when trying to create a Failure from the current interpreter exception state and there is no current exception state.
Function | `format_frames` | Format and write frames.
Function | `startDebugMode` | Enable debug hooks for Failures.
Constant | `DO_POST_MORTEM` | Undocumented
Constant | `EXCEPTION_CAUGHT_HERE` | Undocumented
Variable | `count` | Undocumented
Variable | `traceupLength` | Undocumented
Class | `_Code` | A fake code object, used by `_Traceback` via `_Frame`.
Class | `_Frame` | A fake frame object, used by `_Traceback`.
Class | `_TracebackFrame` | Fake traceback object which can be passed to functions in the standard library `traceback` module.
Function | `_debuginit` | Initialize failure object, possibly spawning pdb.
Function | `_extraneous` | Mark the given callable as extraneous to inlineCallbacks exception reporting; don't show these functions.
Function | `_safeReprVars` | Convert a list of (name, object) pairs into (name, repr) pairs.
Function | `_Traceback` | Construct a fake traceback object using a list of frames.
Variable | `_inlineCallbacksExtraneous` | Undocumented

def format_frames(frames, write, detail='default'): (source)

Format and write frames.

Parameters
frames:list | is a list of frames as used by Failure.frames, with each frame being a list of (funcName, fileName, lineNumber, locals.items(), globals.items())
write:callable | this will be called with formatted strings.
detail:string | Four detail levels are available: default, brief, verbose, and verbose-vars-not-captured. `Failure.printDetailedTraceback` uses the latter when the caller asks for verbose, but no vars were captured, so that an explicit warning about the missing data is shown.

def startDebugMode(): (source)

Enable debug hooks for Failures.

DO_POST_MORTEM: `bool` = (source)

Undocumented

Value

    True

EXCEPTION_CAUGHT_HERE: `str` = (source)

Undocumented

Value

    '--- <exception caught here> ---'

count: `int` = (source)

Undocumented

traceupLength: `int` = (source)

Undocumented

def _debuginit(self, exc_value=None, exc_type=None, exc_tb=None, captureVars=False, Failure__init__=Failure.__init__): (source)

Initialize failure object, possibly spawning pdb.

def _extraneous(f): (source)

Mark the given callable as extraneous to inlineCallbacks exception reporting; don't show these functions.

Parameters
f:function | a function that you NEVER WANT TO SEE AGAIN in ANY TRACEBACK reported by Failure.
Returns
f

def _safeReprVars(varsDictItems): (source)

Convert a list of (name, object) pairs into (name, repr) pairs.

`twisted.python.reflect.safe_repr` is used to generate the repr, so no exceptions will be raised by faulty `__repr__` methods.

Parameters
varsDictItems | a sequence of (name, value) pairs as returned by e.g. `locals().items()`.
Returns
a sequence of (name, repr) pairs.

def _Traceback(stackFrames, tbFrames): (source)

Construct a fake traceback object using a list of frames.

It should have the same API as stdlib to allow interaction with other tools.

Parameters
stackFrames | [(methodname, filename, lineno, locals, globals), ...]
tbFrames | [(methodname, filename, lineno, locals, globals), ...]

_inlineCallbacksExtraneous: `list` = (source)

Undocumented