diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs index 9f80edd63..fc1067575 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs @@ -3,7 +3,9 @@ using NUnit.Framework; using NzbDrone.Core.Download; using NzbDrone.Core.HealthCheck.Checks; +using NzbDrone.Core.Indexers; using NzbDrone.Core.Test.Framework; +using NzbDrone.Core.ThingiProvider; using NzbDrone.Test.Common; namespace NzbDrone.Core.Test.HealthCheck.Checks @@ -25,6 +27,7 @@ public void should_return_warning_when_download_client_has_not_been_configured() public void should_return_error_when_download_client_throws() { var downloadClient = Mocker.GetMock(); + downloadClient.Setup(s => s.Definition).Returns(new IndexerDefinition{Name = "Test"}); downloadClient.Setup(s => s.GetItems()) .Throws(); diff --git a/src/NzbDrone.Core/Download/IDownloadClient.cs b/src/NzbDrone.Core/Download/IDownloadClient.cs index aa46cff48..6703d8a22 100644 --- a/src/NzbDrone.Core/Download/IDownloadClient.cs +++ b/src/NzbDrone.Core/Download/IDownloadClient.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using NzbDrone.Core.Indexers; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.ThingiProvider; diff --git a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs index 8a13ad82d..851c94e84 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs @@ -25,17 +25,19 @@ public override HealthCheck Check() return new HealthCheck(GetType(), HealthCheckResult.Warning, "No download client is available"); } - try + foreach (var downloadClient in downloadClients) { - foreach (var downloadClient in downloadClients) + try { downloadClient.GetItems(); } - } - catch (Exception ex) - { - _logger.Error("Unable to communicate with download client: ", ex); - return new HealthCheck(GetType(), HealthCheckResult.Error, "Unable to communicate with download client: " + ex.Message); + catch (Exception ex) + { + var message = String.Format("Unable to communicate with {0}.", downloadClient.Definition.Name); + + _logger.Error(message, ex); + return new HealthCheck(GetType(), HealthCheckResult.Error, message + " " + ex.Message); + } } return new HealthCheck(GetType());