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 BaseExceptionHandler(IBaseExceptionHandler): (source)
Constructor: BaseExceptionHandler(default_responses, application)
Select logging and protocol presentation through one failure hook.
| Method | __init__ |
Initialize the BaseExceptionHandler instance. |
| Async Method | __log |
Log an exception and its traceback as a single error record. |
| Async Method | __present |
Present the exception only when its HTTP or CLI owner requests it. |
| Async Method | handle |
Render an exception immediately using the supplied console. |
| Async Method | handle |
Select default effects without logging or rendering during observation. |
| Async Method | handle |
Render an exception immediately as an HTTP response. |
| Async Method | handle |
Observe a declared failed result without creating an exception. |
| Method | is |
Determine whether the given exception should be ignored. |
| Async Method | report |
Log an exception immediately using the supplied logger. |
| Method | to |
Convert an exception to a structured Throwable object. |
| Class Variable | dont |
Exceptions that should not be caught by the handler. |
| Instance Variable | __application |
The application instance containing configuration and context. |
| Instance Variable | __default |
Default responses for HTTP error handling. |
Initialize the BaseExceptionHandler instance.
| Parameters | |
defaultorionis.http.default.responses.DefaultResponses | Default responses for HTTP error handling. |
application:orionis.IApplication | The application instance containing configuration and context. |
| Returns | |
None | This method does not return a value. |
Log an exception and its traceback as a single error record.
Preserve chained exceptions and notes using the original exception information, even when reporting outside an active except block.
| Parameters | |
exception:BaseException | The exception instance that was caught. |
| Returns | |
None | No return value. |
BaseException, *, flow: str, request: Request | TransportAdapter | None = None) -> Response | None:
(source)
¶
Present the exception only when its HTTP or CLI owner requests it.
| Parameters | |
exception:BaseException | The exception instance that was caught. |
flow:str | Protocol whose execution owner requested presentation. |
request:Request | TransportAdapter | None | The HTTP request instance or transport adapter that was being processed. |
| Returns | |
orionis.http.Response | None | The HTTP response if handled, otherwise None. |
Render an exception immediately using the supplied console.
Warning
Deprecated and will be removed in a future version. Override handleFailure and return a FailureHandling plan instead. Calling this method emits DeprecationWarning.
| Parameters | |
exception:BaseException | The exception instance that was caught. |
console:orionis.console.output.console.Console | The console instance for output. |
| Returns | |
None | This method does not return a value. |
BaseException, context: FailureContext) -> FailureHandling:
(source)
¶
Select default effects without logging or rendering during observation.
Notes
Return this plan from application overrides to preserve default effects. Logging runs after the hook returns; presentation runs only when the protocol owner requests it. Neither operation invokes this hook again.
| Parameters | |
exception:BaseException | Original exception, including expected failures. |
context:FailureContext | Immutable origin, phase and correlation of the failure. |
| Returns | |
FailureHandling | Logging and presentation owned by this incident's execution. |
BaseException, request: Request | TransportAdapter) -> Response | None:
(source)
¶
Render an exception immediately as an HTTP response.
Warning
Deprecated and will be removed in a future version. Override handleFailure and return a FailureHandling plan instead. Calling this method emits DeprecationWarning.
| Parameters | |
exception:BaseException | The exception instance that was caught. |
request:Request | TransportAdapter | The HTTP request instance or transport adapter that was being processed. |
| Returns | |
orionis.http.Response | None | The HTTP response if handled, otherwise None when ignored. |
object, context: FailureContext) -> FailureHandling | None:
(source)
¶
Observe a declared failed result without creating an exception.
Notes
This default hook does not log or render. Application handlers may override it to apply policy without observing the outcome a second time.
| Parameters | |
value:object | Failed outcome supplied by its execution owner. |
context:FailureContext | Immutable origin, phase and correlation of the outcome. |
| Returns | |
None | No return value. |
Determine whether the given exception should be ignored.
| Parameters | |
exception:BaseException | The exception instance to check. |
| Returns | |
bool | True if the exception should be ignored, otherwise False. |
| Raises | |
TypeError | If the supplied value is not an exception instance. |
Log an exception immediately using the supplied logger.
Warning
Deprecated and will be removed in a future version. Override handleFailure and return a FailureHandling plan instead. Calling this method emits DeprecationWarning.
| Parameters | |
exception:BaseException | The exception instance that was caught. |
log:orionis.logging.contracts.ILogger | The logger instance for error reporting. |
| Returns | |
orionis.failure.entities.Throwable or None | The structured exception if reported, otherwise None when ignored. |
Convert an exception to a structured Throwable object.
| Parameters | |
exception:BaseException | Exception instance to be converted. |
| Returns | |
orionis.failure.entities.Throwable | Structured Throwable object containing class, message, arguments, and traceback. |