From ec829b4eee8411b2cd37e5f4b94b550b6834a2cb Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Sat, 29 Apr 2023 13:22:15 -0700 Subject: [PATCH] Add logging for faulted tasks on successful connections - Diagnostic tool, we don't really care about these exceptions. --- .../Networking/Http/HappyEyeballsCallback.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Dalamud/Networking/Http/HappyEyeballsCallback.cs b/Dalamud/Networking/Http/HappyEyeballsCallback.cs index 1ff6d0d76..af854fb2c 100644 --- a/Dalamud/Networking/Http/HappyEyeballsCallback.cs +++ b/Dalamud/Networking/Http/HappyEyeballsCallback.cs @@ -83,12 +83,7 @@ public class HappyEyeballsCallback : IDisposable // If we're here, it means we have a successful connection. A failure to connect would have caused the above // line to explode, so we're safe to clean everything up. linkedToken.Cancel(); - tasks.ForEach(task => - { - // Suppress any other exceptions that come down the pipe. We've already thrown an exception we cared - // about above. - task.ContinueWith(inner => { _ = inner.Exception; }); - }); + tasks.ForEach(task => { task.ContinueWith(this.CleanupConnectionTask); }); return stream; } @@ -133,4 +128,16 @@ public class HappyEyeballsCallback : IDisposable return Util.ZipperMerge(groups).ToList(); } + + private void CleanupConnectionTask(Task task) + { + // marks the exception as handled as well, nifty! + // will also handle canceled cases, which aren't explicitly faulted. + var exception = task.Exception; + + if (task.IsFaulted) + { + Log.Verbose(exception!, "A HappyEyeballs connection task failed. Are there network issues?"); + } + } }