THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class ExceptionParser(IExceptionParser): (source)
Constructor: ExceptionParser(exception)
Undocumented
| Method | __init__ |
Initialize ExceptionParser with an exception instance. |
| Method | _get |
Extract source code lines around a specific line number from a file. |
| Method | _parse |
Parse stack trace summary into frame dictionaries. |
| Method | to |
Serialize exception details into a dictionary. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _cache |
Undocumented |
| Instance Variable | _error |
Undocumented |
| Instance Variable | _exc |
Undocumented |
| Instance Variable | _tb |
Undocumented |
Initialize ExceptionParser with an exception instance.
Eagerly parses the exception traceback and metadata on construction so repeated calls to toDict() pay no extra CPU cost.
| Parameters | |
exception:Exception | Exception to be parsed and formatted. |
| Returns | |
None | Complete the documented operation without returning a value. |
str | None, lineno: int | None) -> tuple[ list[ int], list[ str]]:
(source)
¶
Extract source code lines around a specific line number from a file.
Reuses cached file lines and builds the requested source window.
| Parameters | |
filename:str | None | Path to the source file to read from. |
lineno:int | None | Line number to center the code extraction around. |
| Returns | |
tuple[list[int], list[str]] | Tuple containing line numbers and corresponding source code lines. |
Parse stack trace summary into frame dictionaries.
Iterate over the stack in reverse to produce the most-recent-first order. FrameSummary attributes are provided by the traceback contract.
| Parameters | |
stack:traceback.StackSummary | list | Stack trace summary or an empty list. |
| Returns | |
list[dict[str, Any]] | List of frame dicts ordered most-recent first. |
Serialize exception details into a dictionary.
The result is cached after the first call; subsequent calls return the same dict with no additional computation.
| Returns | |
dict[str, Any] | Dictionary with keys: - 'error_type': str, type of the exception. - 'error_message': str, formatted traceback string. - 'error_code': Any, custom error code if present. - 'stack_trace': list[dict], frame details. |