aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-11-02 20:07:55 -0500
committerJP Dillingham <jp@dillingham.me>2024-11-02 20:07:55 -0500
commitc907e234a98c9754e77adfefaf85d97021d0ece9 (patch)
treecb2199a927979137ef692acddcd20ef1a39e5e0d /src
parentf9ad53f89f255891a51ca442bb23c1d58ccf3bd0 (diff)
downloadslskd-c907e234a98c9754e77adfefaf85d97021d0ece9.tar.gz
don't log exceptions when the task doesn't throw
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Events/EventBus.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/slskd/Events/EventBus.cs b/src/slskd/Events/EventBus.cs
index 16b7c9e1..e1515ac3 100644
--- a/src/slskd/Events/EventBus.cs
+++ b/src/slskd/Events/EventBus.cs
@@ -103,7 +103,8 @@ 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<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))));
+ .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)));
}
}