Register a callable that will be invoked when the driver thread
detects an error on the Endpoint. The callable is invoked with the
instance of the Endpoint object passed as the first argument. The second
argument is an Exception instance describing the failure.
Note:
The exception will also be raised the next time the application
invokes one of the blocking messaging APIs.
Warning:
Use with caution This callback is invoked in the context of
the driver thread. It is NOT safe to call ANY of the
messaging APIs from within this callback. This includes any of the
Endpoint's methods. The intent of the handler is to provide an
efficient way to notify the application that an exception has
occurred in the driver thread. This can be useful for those
applications that periodically poll the messaging layer for events.
In this case the callback can be used to schedule a task that
retrieves the error using the Endpoint's get_error() or
check_error() methods.