From 48dc932c5fad4bb01933eedc5355f5e0c2433ec9 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 28 Oct 2026 19:07:50 -0500 Subject: take last exception when finalizing --- src/slskd/Transfers/Downloads/DownloadService.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index c9095dd5..d847f79c 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -1059,6 +1059,12 @@ namespace slskd.Transfers.Downloads t.EndedAt ??= DateTime.UtcNow; + // Retry.Do() wraps failures in an AggregateException; use the most recent so that the state reflects what happened + if (exception is AggregateException aggregate && aggregate.InnerExceptions.Count > 0) + { + exception = aggregate.InnerExceptions[^1]; + } + // Soulseek.NET will include the filename and username in some messages; this is useful for many things but not tracking // exceptions in a database. when we encounter one of these, drop the first segment. var m = exception.Message; -- cgit v1.2.3