diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/ConnectionWatchdog.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/slskd/Core/ConnectionWatchdog.cs b/src/slskd/Core/ConnectionWatchdog.cs index a598ff7a..9964514b 100644 --- a/src/slskd/Core/ConnectionWatchdog.cs +++ b/src/slskd/Core/ConnectionWatchdog.cs @@ -209,6 +209,12 @@ namespace slskd break; } + catch (Exception ex) when (ex is TaskCanceledException || ex is OperationCanceledException) + { + Log.Information("Reconnection attempt cancelled"); + Log.Debug(ex, "ConnectAsync() threw {Exception}", ex); + return; + } catch (Exception ex) { attempts++; @@ -216,6 +222,15 @@ namespace slskd } } } + catch (Exception ex) when (ex is TaskCanceledException || ex is OperationCanceledException) + { + Log.Information("Reconnection attempt cancelled"); + Log.Debug(ex, "Reconnect logic threw {Exception}", ex); + } + catch (Exception ex) + { + Log.Warning(ex, "Reconnect attempt failed: {Message}", ex.Message); + } finally { CancellationTokenSource?.Dispose(); |
