diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-11-02 20:36:56 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-11-02 20:36:56 -0500 |
| commit | 600a15aaa031146378a127dcf60c596747a545a6 (patch) | |
| tree | b767363e4a9ce702142552c51fbf857f4371ce5f /src | |
| parent | 8b8600be763119db7f79ff6d0e734b54fd24dafd (diff) | |
| download | slskd-600a15aaa031146378a127dcf60c596747a545a6.tar.gz | |
tweak continuation options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Events/EventBus.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/slskd/Events/EventBus.cs b/src/slskd/Events/EventBus.cs index e1515ac3..ae3350f0 100644 --- a/src/slskd/Events/EventBus.cs +++ b/src/slskd/Events/EventBus.cs @@ -88,7 +88,9 @@ public class EventBus // we don't care about any of these tasks; contractually we are only obligated to invoke them _ = Task.WhenAll(subscribers.Select(subscriber => Task.Run(() => (subscriber.Value as Func<T, Task>)(data)) - .ContinueWith(task => Log.Error(task.Exception, "Subscriber {Name} for {Type} encountered an error: {Message}", subscriber.Key, typeof(T), task.Exception.Message)))); + .ContinueWith( + task => Log.Error(task.Exception, "Subscriber {Name} for {Type} encountered an error: {Message}", subscriber.Key, typeof(T), task.Exception.Message), + continuationOptions: TaskContinuationOptions.OnlyOnFaulted))); } else { @@ -104,7 +106,8 @@ public class EventBus _ = Task.WhenAll(subscribers.Select(subscriber => Task.Run(() => (subscriber.Value as Func<Event, Task>)(data)) .ContinueWith( - task => Log.Error(task.Exception, "Catch-All Subscriber {Name} for {Type} encountered an error: {Message}", subscriber.Key, typeof(Event), task.Exception.Message), TaskContinuationOptions.OnlyOnFaulted))); + task => Log.Error(task.Exception, "Catch-All Subscriber {Name} for {Type} encountered an error: {Message}", subscriber.Key, typeof(Event), task.Exception.Message), + continuationOptions: TaskContinuationOptions.OnlyOnFaulted))); } } |
