hooks.exceptions module¶
Provides exception hooking functionality.
- @hooks.exceptions.ExceptHook[source]¶
Bases:
hooks.base._HookDecorator
Fired when an exception is raised.
The decorated function is passed the following parameters whe an exception is raised:
- Parameters:
exc_type (Exception) – The type of
Exception
that was raised.value (Exception) – The instance of the
Exception
that was raised.trace_back (types.TracebackType) – The traceback info for the raised exception.
from hooks.exceptions import ExceptHook @ExceptHook def exception_callback(exc_type, value, trace_back): # Code...
See also
- hooks.exceptions.except_hooks¶
The singleton object of the
_ExceptHooks
class.