Fork me on GitHub

Exception Handling

Exceptions thrown by the Event Broker

The event broker will throw an exception during registration when

Exceptions thrown by Subscribers

When a subscriber throws an exception while handling an event it depends on whether the handler is synchronous or asynchronous. An exception thrown by a synchronous handler is passed to the publisher. An exception of an asynchronous handler can only be catched by the global .net background thread exception handler.

You can get better control over exception throwing subscribers by implementing an extension. All built-in handlers call SubscriberExceptionOccurred on all extensions. An extension can then mark the exception as handled and the event broker won't re-throw the exception.