From e968919e63616e30cc401964bd51db8e9e0e26de Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Wed, 22 Feb 2023 19:36:12 -0600 Subject: [PATCH] Fixed: Improve some request failure messaging --- .../Download/Clients/Deluge/Deluge.cs | 6 ++--- .../ImportLists/Custom/CustomImportProxy.cs | 6 ++--- .../ImportLists/HttpImportListBase.cs | 8 +++---- .../ImportLists/Sonarr/SonarrV3Proxy.cs | 8 +++---- src/NzbDrone.Core/Indexers/HttpIndexerBase.cs | 2 +- src/NzbDrone.Core/Indexers/Newznab/Newznab.cs | 24 +++++++++---------- src/NzbDrone.Core/Indexers/Torznab/Torznab.cs | 2 +- .../Notifications/Notifiarr/NotifiarrProxy.cs | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index d07b1137a..787503b16 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -175,7 +175,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge } // Here we detect if Deluge is managing the torrent and whether the seed criteria has been met. - // This allows drone to delete the torrent as appropriate. + // This allows Sonarr to delete the torrent as appropriate. item.CanMoveFiles = item.CanBeRemoved = torrent.IsAutoManaged && torrent.StopAtRatio && @@ -254,12 +254,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge case WebExceptionStatus.ConnectionClosed: return new NzbDroneValidationFailure("UseSsl", "Verify SSL settings") { - DetailedDescription = "Please verify your SSL configuration on both Deluge and NzbDrone." + DetailedDescription = "Please verify your SSL configuration on both Deluge and Sonarr." }; case WebExceptionStatus.SecureChannelFailure: return new NzbDroneValidationFailure("UseSsl", "Unable to connect through SSL") { - DetailedDescription = "Drone is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both drone and Deluge to not use SSL." + DetailedDescription = "Sonarr is unable to connect to Deluge using SSL. This problem could be computer related. Please try to configure both Sonarr and Deluge to not use SSL." }; default: return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); diff --git a/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs b/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs index 4eaac9976..6c62b2c3d 100644 --- a/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs +++ b/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs @@ -49,13 +49,13 @@ namespace NzbDrone.Core.ImportLists.Custom return new ValidationFailure("BaseUrl", "It seems we are unauthorized to make this request."); } - _logger.Error(ex, "Unable to send test message"); + _logger.Error(ex, "Unable to connect to import list."); return new ValidationFailure("BaseUrl", $"We are unable to make the request to that URL. StatusCode: {ex.Response.StatusCode}"); } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message"); - return new ValidationFailure("", "Unable to send test message"); + _logger.Error(ex, "Unable to connect to import list."); + return new ValidationFailure(string.Empty, "Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); } return null; diff --git a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs index f350853de..67a172a99 100644 --- a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs +++ b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs @@ -215,8 +215,8 @@ namespace NzbDrone.Core.ImportLists if (releases.Empty()) { return new NzbDroneValidationFailure(string.Empty, - "No results were returned from your import list, please check your settings.") - { IsWarning = true }; + "No results were returned from your import list, please check your settings and the log for details.") + { IsWarning = true }; } } catch (RequestLimitReachedException) @@ -233,13 +233,13 @@ namespace NzbDrone.Core.ImportLists { _logger.Warn(ex, "Unable to connect to import list"); - return new ValidationFailure(string.Empty, "Unable to connect to import list. " + ex.Message); + return new ValidationFailure(string.Empty, "Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); } catch (Exception ex) { _logger.Warn(ex, "Unable to connect to import list"); - return new ValidationFailure(string.Empty, "Unable to connect to import list, check the log for more details"); + return new ValidationFailure(string.Empty, "Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); } return null; diff --git a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs index 3a53ad134..128776175 100644 --- a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs +++ b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs @@ -63,13 +63,13 @@ namespace NzbDrone.Core.ImportLists.Sonarr return new ValidationFailure("ApiKey", "API Key is invalid"); } - _logger.Error(ex, "Unable to send test message"); - return new ValidationFailure("ApiKey", "Unable to send test message"); + _logger.Error(ex, "Unable to connect to import list."); + return new ValidationFailure(string.Empty, "Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message"); - return new ValidationFailure("", "Unable to send test message"); + _logger.Error(ex, "Unable to connect to import list."); + return new ValidationFailure(string.Empty, "Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); } return null; diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index 7adeb3978..a092a9778 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -389,7 +389,7 @@ namespace NzbDrone.Core.Indexers { _logger.Warn(ex, "Unable to connect to indexer"); - return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details"); + return new ValidationFailure(string.Empty, "Unable to connect to indexer: {ex.Message}. Check the log surrounding this error for details"); } return null; diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 3043a042a..a8b16a0c3 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -64,17 +64,17 @@ namespace NzbDrone.Core.Indexers.Newznab private IndexerDefinition GetDefinition(string name, NewznabSettings settings) { return new IndexerDefinition - { - EnableRss = false, - EnableAutomaticSearch = false, - EnableInteractiveSearch = false, - Name = name, - Implementation = GetType().Name, - Settings = settings, - Protocol = DownloadProtocol.Usenet, - SupportsRss = SupportsRss, - SupportsSearch = SupportsSearch - }; + { + EnableRss = false, + EnableAutomaticSearch = false, + EnableInteractiveSearch = false, + Name = name, + Implementation = GetType().Name, + Settings = settings, + Protocol = DownloadProtocol.Usenet, + SupportsRss = SupportsRss, + SupportsSearch = SupportsSearch + }; } private NewznabSettings GetSettings(string url, string apiPath = null, int[] categories = null, int[] animeCategories = null) @@ -134,7 +134,7 @@ namespace NzbDrone.Core.Indexers.Newznab { _logger.Warn(ex, "Unable to connect to indexer: " + ex.Message); - return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details"); + return new ValidationFailure(string.Empty, "Unable to connect to indexer: {ex.Message}. Check the log surrounding this error for details"); } } diff --git a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs index 40bde50a0..b1cfb87e9 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/Torznab.cs @@ -126,7 +126,7 @@ namespace NzbDrone.Core.Indexers.Torznab { _logger.Warn(ex, "Unable to connect to indexer: " + ex.Message); - return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details"); + return new ValidationFailure(string.Empty, "Unable to connect to indexer: {ex.Message}. Check the log surrounding this error for details"); } } diff --git a/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs b/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs index 107a6fc68..382253bcd 100644 --- a/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs +++ b/src/NzbDrone.Core/Notifications/Notifiarr/NotifiarrProxy.cs @@ -57,7 +57,7 @@ namespace NzbDrone.Core.Notifications.Notifiarr catch (Exception ex) { _logger.Error(ex, ex.Message); - return new ValidationFailure("", "Unable to send test notification. Check the log for more details."); + return new ValidationFailure(string.Empty, "Unable to send test notification: {ex.Message}. Check the log surrounding this error for details"); } }