Better Captcha message.

This commit is contained in:
Taloth Saldono
2016-08-20 19:37:31 +02:00
parent 28f6777f9a
commit 7f6101a6bc
4 changed files with 30 additions and 5 deletions

View File

@@ -246,6 +246,18 @@ namespace NzbDrone.Core.Indexers
_indexerStatusService.RecordFailure(Definition.Id);
_logger.Warn("Invalid API Key for {0} {1}", this, url);
}
catch (CloudFlareCaptchaException ex)
{
_indexerStatusService.RecordFailure(Definition.Id);
if (ex.IsExpired)
{
_logger.Error(ex, "Expired CAPTCHA token for {0}, please refresh in indexer settings.", this);
}
else
{
_logger.Error(ex, "CAPTCHA token required for {0}, check indexer settings.", this);
}
}
catch (IndexerException ex)
{
_indexerStatusService.RecordFailure(Definition.Id);
@@ -314,9 +326,16 @@ namespace NzbDrone.Core.Indexers
{
_logger.Warn("Request limit reached");
}
catch (CloudFlareCaptchaException)
catch (CloudFlareCaptchaException ex)
{
return new ValidationFailure("CaptchaToken", "Site protected by CloudFlare CAPTCHA. Valid CAPTCHA token required.");
if (ex.IsExpired)
{
return new ValidationFailure("CaptchaToken", "CloudFlare CAPTCHA token expired, please Refresh.");
}
else
{
return new ValidationFailure("CaptchaToken", "Site protected by CloudFlare CAPTCHA. Valid CAPTCHA token required.");
}
}
catch (UnsupportedFeedException ex)
{