happyly.handling.dummy_handler._DummyHandler¶
-
class
happyly.handling.dummy_handler._DummyHandler¶ Bases:
happyly.handling.handler.Handlerhandle(message)Applies logic using a provided message, optionally gives back one or more results.
on_handling_failed(message, error)Applies fallback logic using a provided message when
handle()fails, optionally gives back one or more results.-
handle(message)¶ Applies logic using a provided message, optionally gives back one or more results. Each result consists of message attributes which can be serialized and sent. When fails, calls
on_handling_failed()
-
on_handling_failed(message, error)¶ Applies fallback logic using a provided message when
handle()fails, optionally gives back one or more results. Enforces users ofHandlerclass to provide explicit strategy for errors.If you want to propagate error further to the underlying Executor/Handler, just re-raise an
errorhere:def on_handling_failed(self, message, error): raise error
-