Skipping as well
This commit is contained in:
1 parent
ad54625980
commit
e3381e9748
2 files changed
+14
-1
No files matched your search
@@ -31,8 +31,12 @@ open class EventDispatcher(val eventStore: EventStore) {
|
|||||||
if (result != null) {
|
if (result != null) {
|
||||||
eventStore.persist(result)
|
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) {
|
} 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}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,13 @@ sealed class SoftDispatchException(
|
|||||||
message = "Listener forcibly ejected: $reason",
|
message = "Listener forcibly ejected: $reason",
|
||||||
eventType = currentEvent
|
eventType = currentEvent
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class UnqualifiedEntryEventException(
|
||||||
|
currentEvent: Class<out Event>
|
||||||
|
) : SoftDispatchException(
|
||||||
|
message = "Listener did not receive qualified entry event: ${currentEvent.simpleName}",
|
||||||
|
eventType = currentEvent
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user