-
Piotr Maślanka authored1ffce0f3
exception_handling.rst 2.19 KiB
Exception handling
Satella provides a rich functionality to register exception hooks.
Note
Satella does not install a custom faulthandler. Do it yourself.
Writing your own exception handlers
To write your own exception handlers, subclass the following class:
And then instantiate it and call install()
.
If you got a callable of signature [type, BaseException, types.TracebackType] (type, value, traceback) that returns True upon a request to swallow the exception, you can convert it to a Satella exception handler in two ways.
First:
a = FunctionExceptionHandler(exception_handle)
a.install()