Fixed: Indexers that do not support movie search should give better error messages. Radarr now also complains if an indexer does not support certain categories.

This commit is contained in:
Leonardo Galli
2018-05-08 22:19:36 +02:00
parent 58044e0104
commit d1c2569aa6
5 changed files with 77 additions and 6 deletions

View File

@@ -298,7 +298,8 @@ namespace NzbDrone.Core.Indexers
if (releases.Empty())
{
return new ValidationFailure(string.Empty, "No results were returned from your indexer, please check your settings.");
return new ValidationFailure(string.Empty,
"No results were returned from your indexer, please check your settings.");
}
}
catch (ApiKeyException)
@@ -319,7 +320,8 @@ namespace NzbDrone.Core.Indexers
}
else
{
return new ValidationFailure("CaptchaToken", "Site protected by CloudFlare CAPTCHA. Valid CAPTCHA token required.");
return new ValidationFailure("CaptchaToken",
"Site protected by CloudFlare CAPTCHA. Valid CAPTCHA token required.");
}
}
catch (UnsupportedFeedException ex)
@@ -334,6 +336,21 @@ namespace NzbDrone.Core.Indexers
return new ValidationFailure(string.Empty, "Unable to connect to indexer. " + ex.Message);
}
catch (HttpException ex)
{
if (ex.Response.StatusCode == HttpStatusCode.BadRequest &&
ex.Response.Content.Contains("not support the requested query"))
{
_logger.Warn(ex, "Indexer does not support the query");
return new ValidationFailure(string.Empty, "Indexer does not support the current query. Check if the categories and or searching for movies are supported. Check the log for more details.");
}
else
{
_logger.Warn(ex, "Unable to connect to indexer");
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
}
}
catch (Exception ex)
{
_logger.Warn(ex, "Unable to connect to indexer");