mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add logging for faulted tasks on successful connections
- Diagnostic tool, we don't really care about these exceptions.
This commit is contained in:
parent
76190d7e59
commit
ec829b4eee
1 changed files with 13 additions and 6 deletions
|
|
@ -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?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue