Μετάβαση στο περιεχόμενο

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.

const subscription = cqrs.unhandledExceptionBus.subscribe(({ cause, exception }) =>
alerts.notify(cause.constructor.name, exception),
);
subscription.unsubscribe();

Cause = IEvent

new UnhandledExceptionBus<Cause>(): UnhandledExceptionBus<Cause>

UnhandledExceptionBus<Cause>

publish(info): void

Defined in: packages/cqrs/src/unhandled-exception.bus.ts:51

Delivers a failure to every current subscriber, synchronously.

UnhandledExceptionInfo<Cause>

void

unhandledExceptionBus.publish({ cause: event, exception: error });

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.

(info) => void

Subscription

const subscription = unhandledExceptionBus.subscribe((info) => logger.error(info.exception));