Skip to content

Exception Module

This module provides exception handling functions.

ExceptionManager()

An exception manager collects all registered handlers and is able to handle an exception by dispatching it to the most applicable handler ( according to mro )

handle(exception)

handle an exception by invoking the most applicable handler (according to mro) and return a possible modified exception as a result.

Parameters:

Name Type Description Default
exception BaseException

the exception

required

Returns:

Name Type Description
BaseException BaseException

the resulting exception

proceed() classmethod

proceed with the next most applicable handler

Returns:

Name Type Description
BaseException BaseException

the resulting exception

exception_handler()

This annotation is used to mark classes that container handlers for exceptions

handle()

Any method annotated with @handle will be registered as an exception handler method.