From fa89d33900a1cdd0daf924cd131f39dcf9cdc7d6 Mon Sep 17 00:00:00 2001 From: margaale Date: Tue, 21 Feb 2017 18:58:54 -0300 Subject: [PATCH] Fix for key not found, returning a generic error instead --- .../DownloadStation/Responses/DiskStationError.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/Responses/DiskStationError.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/Responses/DiskStationError.cs index af818313e..d8ce31d71 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/Responses/DiskStationError.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/Responses/DiskStationError.cs @@ -83,16 +83,23 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation.Responses { return AuthMessages[Code]; } + if (api == DiskStationApi.DownloadStationTask && DownloadStationTaskMessages.ContainsKey(Code)) { return DownloadStationTaskMessages[Code]; } + if (api == DiskStationApi.FileStationList && FileStationMessages.ContainsKey(Code)) { return FileStationMessages[Code]; } - return CommonMessages[Code]; + if (CommonMessages.ContainsKey(Code)) + { + return CommonMessages[Code]; + } + + return $"{ Code } - Unknown error"; } } }