diff --git a/src/main/kotlin/no/iktdev/eventi/events/EventDispatcher.kt b/src/main/kotlin/no/iktdev/eventi/events/EventDispatcher.kt index cb9a951..9c38995 100644 --- a/src/main/kotlin/no/iktdev/eventi/events/EventDispatcher.kt +++ b/src/main/kotlin/no/iktdev/eventi/events/EventDispatcher.kt @@ -31,8 +31,12 @@ open class EventDispatcher(val eventStore: EventStore) { if (result != null) { eventStore.persist(result) } + } catch (e: SoftDispatchException.UnqualifiedEntryEventException) { + log.debug("Soft-dispatch skip (unqualified entry): ${e.message}") + } catch (e: SoftDispatchException.SkipListenerException) { + log.debug("Soft-dispatch skip: ${e.message}") } catch (e: SoftDispatchException) { - log.warn( "Soft-dispatch in ${listener::class.simpleName} " + "for event ${e.eventType?.simpleName ?: "Unknown"}: ${e.message}" ) + log.warn("Soft-dispatch in ${listener::class.simpleName} for event ${e.eventType?.simpleName}: ${e.message}") } } } diff --git a/src/main/kotlin/no/iktdev/eventi/events/SoftDispatchExceptions.kt b/src/main/kotlin/no/iktdev/eventi/events/SoftDispatchExceptions.kt index f8cb3b0..5cc6a9a 100644 --- a/src/main/kotlin/no/iktdev/eventi/events/SoftDispatchExceptions.kt +++ b/src/main/kotlin/no/iktdev/eventi/events/SoftDispatchExceptions.kt @@ -29,4 +29,13 @@ sealed class SoftDispatchException( message = "Listener forcibly ejected: $reason", eventType = currentEvent ) + + class UnqualifiedEntryEventException( + currentEvent: Class + ) : SoftDispatchException( + message = "Listener did not receive qualified entry event: ${currentEvent.simpleName}", + eventType = currentEvent + ) + + }