aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-07-12 17:39:54 -0500
committerJP Dillingham <jp@dillingham.me>2025-07-12 17:39:54 -0500
commitb267938b5dee056e92670c54f4afcf6c008d705c (patch)
treead1274de59f80f6e01db2234b46b7ae74ab41473 /src
parent367b2cee4d475277fb278e6537f1014436d5a09f (diff)
downloadslskd-b267938b5dee056e92670c54f4afcf6c008d705c.tar.gz
set canceled state
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Search/SearchService.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/slskd/Search/SearchService.cs b/src/slskd/Search/SearchService.cs
index ac99ee2e..98001396 100644
--- a/src/slskd/Search/SearchService.cs
+++ b/src/slskd/Search/SearchService.cs
@@ -311,11 +311,10 @@ namespace slskd.Search
{
try
{
- // the only way we should ever get to this point is if we encounter an error sending the search
- // request to the server (timeout, cancelled) or hit some highly improbable error within Soulseek.NET,
- // potentially OOM or something. in these cases the task will throw and we need to force the
- // search record into Errored state.
- if (task.IsFaulted)
+ catch (OperationCanceledException)
+ {
+ search.State = SearchStates.Completed | SearchStates.Cancelled;
+ }
{
Log.Error(task.Exception, "Failed to execute search for '{Query}' (id: {Id}): {Message}", query, id, task.Exception?.Message ?? "Task completed in Faulted state, but there is no Exception");
search.State = SearchStates.Completed | SearchStates.Errored;