Properly Handle Nested Dispatches #19

Merged
kske merged 3 commits from b/nested-dispatch into develop 2021-07-12 11:25:05 +02:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit 6eebd3c121 - Show all commits

View File

@ -94,14 +94,14 @@ public final class EventBus {
try {
handlers.next().execute(event);
} catch (InvocationTargetException e) {
if (event instanceof DeadEvent || event instanceof ExceptionEvent)
// Warn about system event not being handled
logger.log(Level.WARNING, event + " not handled due to exception", e);
else if (e.getCause() instanceof Error)
if (e.getCause() instanceof Error)
// Transparently pass error to the caller
throw (Error) e.getCause();
else if (event instanceof DeadEvent || event instanceof ExceptionEvent)
// Warn about system event not being handled
logger.log(Level.WARNING, event + " not handled due to exception", e);
else
// Dispatch exception event