Fixed: EZTV logging generic error when there were no results

This commit is contained in:
Mark McDowall
2014-12-03 17:22:14 -08:00
parent 0cc4639e65
commit 29ee0ef2be
6 changed files with 48 additions and 29 deletions
@@ -16,19 +16,19 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet
{
var results = new List<ReleaseInfo>();
if (indexerResponse.HttpResponse.StatusCode == System.Net.HttpStatusCode.Unauthorized)
if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.Unauthorized)
{
throw new ApiKeyException("API Key invalid or not authorized");
}
else if (indexerResponse.HttpResponse.StatusCode == System.Net.HttpStatusCode.NotFound)
else if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.NotFound)
{
throw new IndexerException(indexerResponse, "Indexer API call returned NotFound, the Indexer API may have changed.");
}
else if (indexerResponse.HttpResponse.StatusCode == System.Net.HttpStatusCode.ServiceUnavailable)
else if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.ServiceUnavailable)
{
throw new RequestLimitReachedException("Cannot do more than 150 API requests per hour.");
}
else if (indexerResponse.HttpResponse.StatusCode != System.Net.HttpStatusCode.OK)
else if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
{
throw new IndexerException(indexerResponse, "Indexer API call returned an unexpected StatusCode [{0}]", indexerResponse.HttpResponse.StatusCode);
}