Event Handler Exception Handling With Events #11

Closed
opened 2021-02-20 22:18:51 +01:00 by kske · 0 comments
Owner

At the moment, an exception thrown by an event handler is propagated back to the caller of EventBus#dispatch(Object) as an unchecked EventBusException.

This behavior could be improved by introducing an ExceptionEvent which is similar to DeadEvent as they both wrap other events and can only be dispatched by the event bus.

With this event, unexpected exceptions can be handled in a clean and centralized way.

Exception events must not cause dead events as this might cause an indirect recursion when a dead event handler throws an exception. Instead, system events (DeadEvent and ExceptionEvent) should not be able to produce instances of other system events.

At the moment, an exception thrown by an event handler is propagated back to the caller of `EventBus#dispatch(Object)` as an unchecked `EventBusException`. This behavior could be improved by introducing an `ExceptionEvent` which is similar to `DeadEvent` as they both wrap other events and can only be dispatched by the event bus. With this event, unexpected exceptions can be handled in a clean and centralized way. Exception events must not cause dead events as this might cause an indirect recursion when a dead event handler throws an exception. Instead, system events (`DeadEvent` and `ExceptionEvent`) should not be able to produce instances of other system events.
kske added the
enhancement
label 2021-02-20 22:18:51 +01:00
kske self-assigned this 2021-02-20 22:18:51 +01:00
kske added the
core
label 2021-02-20 22:21:27 +01:00
kske closed this issue 2021-02-21 14:04:26 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: zdm/event-bus#11
No description provided.