UnhandledExceptionBus
Defined in: packages/cqrs/src/unhandled-exception.bus.ts:22
Receives the failures of event handlers, which nothing awaits. EventBus publishes
each one here before it logs it.
Example
Section titled “Example”const subscription = cqrs.unhandledExceptionBus.subscribe(({ cause, exception }) => alerts.notify(cause.constructor.name, exception),);subscription.unsubscribe();Type Parameters
Section titled “Type Parameters”Cause = IEvent
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new UnhandledExceptionBus<
Cause>():UnhandledExceptionBus<Cause>
Returns
Section titled “Returns”UnhandledExceptionBus<Cause>
Methods
Section titled “Methods”publish()
Section titled “publish()”publish(
info):void
Defined in: packages/cqrs/src/unhandled-exception.bus.ts:51
Delivers a failure to every current subscriber, synchronously.
Parameters
Section titled “Parameters”UnhandledExceptionInfo<Cause>
Returns
Section titled “Returns”void
Example
Section titled “Example”unhandledExceptionBus.publish({ cause: event, exception: error });subscribe()
Section titled “subscribe()”subscribe(
next):Subscription
Defined in: packages/cqrs/src/unhandled-exception.bus.ts:37
Calls next with every failure published from now on, until the subscription ends.
A listener that throws does not stop the others; its error is thrown on a later
tick, as an uncaught exception.
Parameters
Section titled “Parameters”(info) => void
Returns
Section titled “Returns”Example
Section titled “Example”const subscription = unhandledExceptionBus.subscribe((info) => logger.error(info.exception));