diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-28 19:07:50 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-28 19:07:50 -0500 |
| commit | 48dc932c5fad4bb01933eedc5355f5e0c2433ec9 (patch) | |
| tree | f4de289d89aa7bbcf7a234870311df4c9caf04aa | |
| parent | 053e68f5ca0acf8e3f0ec914b4136a22a4a1b6db (diff) | |
| download | slskd-48dc932c5fad4bb01933eedc5355f5e0c2433ec9.tar.gz | |
take last exception when finalizing
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 6 |
1 files changed, 6 insertions, 0 deletions
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; |
