From f0b0934b06724f227ed725e65a20dff6d10a5bcc Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Mon, 3 Mar 2025 22:01:05 +0100 Subject: [PATCH] Catch SocketException when listing remote files --- HyperbolicDownloaderApi/Commands/HostCommands.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/HyperbolicDownloaderApi/Commands/HostCommands.cs b/HyperbolicDownloaderApi/Commands/HostCommands.cs index c38514f..2a94198 100644 --- a/HyperbolicDownloaderApi/Commands/HostCommands.cs +++ b/HyperbolicDownloaderApi/Commands/HostCommands.cs @@ -197,11 +197,7 @@ public class HostCommands(HostsManager hostsManager) ApiManager.SendNotificationMessageNewLine($"Invalid response!", NotificationMessageType.Error); } } - catch (SocketException ex) - { - ApiManager.SendNotificationMessageNewLine($"Invalid host! Error message: {ex.Message}", NotificationMessageType.Error); - } - catch (IOException ex) + catch (Exception ex) when (ex is SocketException or IOException or AggregateException) { ApiManager.SendNotificationMessageNewLine($"Invalid host! Error message: {ex.Message}", NotificationMessageType.Error); }