log newsnab 429 errors as warn instead of exceptions

This commit is contained in:
Keivan Beigi
2014-10-03 10:50:43 -07:00
parent 7b2e3ef0c4
commit a44be4d902
8 changed files with 66 additions and 53 deletions

View File

@@ -152,6 +152,15 @@ namespace NzbDrone.Core.Indexers
_logger.Warn("{0} {1} {2}", this, url, webException.Message);
}
}
catch (HttpException httpException)
{
if ((int)httpException.Response.StatusCode == 429)
{
_logger.Warn("API Request Limit reached for {0}", this);
}
_logger.Warn("{0} {1}", this, httpException.Message);
}
catch (RequestLimitReachedException)
{
// TODO: Backoff for x period.