This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
eventbrokerexceptionhandling.html
61 lines (58 loc) · 2.26 KB
/
eventbrokerexceptionhandling.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
layout: documentation
title: EventBroker
teaser: Decoupled eventing with automatic thread switching
navigation:
- name: Overview
link: eventbroker.html
- name: Tutorial
link: eventbrokertutorial.html
- name: Registration by Attribute
link: eventbrokerregistrationbyattribute.html
- name: Registration over Interface
link: eventbrokerregistrationoverinterface.html
- name: Registration by Registrar
link: eventbrokerregistrationbyregistrar.html
- name: Simplified Handler Methods
link: eventbrokersimplifiedhandlermethods.html
- name: Direct Interaction
link: eventbrokerdirectinteraction.html
- name: Handlers
link: eventbrokerhandlers.html
- name: Matchers
link: eventbrokermatchers.html
- name: Exception Handling
link: eventbrokerexceptionhandling.html
- name: Extensions
link: eventbrokerextensions.html
- name: Logging
link: eventbrokerlogging.html
- name: Testability
link: eventbrokertestability.html
- name: Tips and Tricks
link: eventbrokertipsandtricks.html
- name: Specifications
link: eventbrokerspecifications.html
---
<h2>Exception Handling</h2>
<h3>Exceptions thrown by the Event Broker</h3>
<p>
The event broker will throw an exception during registration when
<ul>
<li>the publisher or subscriber was already registered for the event topic</li>
<li>the publisher and subscriber do not match (handler restrictions, publisher event args not assignable to subscriber event args</li>
<li>the event or handler method signature cannot be handled</li>
</ul>
</p>
<h3>Exceptions thrown by Subscribers</h3>
<p>
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.
</p>
<p>
You can get better control over exception throwing subscribers by implementing an
<a href="eventbrokerextensions.html">extension</a>. All built-in handlers call
<code>SubscriberExceptionOccurred</code> on all extensions. An extension can then mark the exception as handled
and the event broker won't re-throw the exception.
</p>