Fixed: Do not prevent adding of indexer when API request limit was reached

pull/6/head
Mark McDowall 11 years ago
parent 0cad77303d
commit 357726ed09

@ -0,0 +1,17 @@
using NzbDrone.Common.Exceptions;
namespace NzbDrone.Core.Indexers.Exceptions
{
public class RequestLimitReachedException : NzbDroneException
{
public RequestLimitReachedException(string message, params object[] args)
: base(message, args)
{
}
public RequestLimitReachedException(string message)
: base(message)
{
}
}
}

@ -24,6 +24,11 @@ namespace NzbDrone.Core.Indexers.Newznab
throw new ApiKeyException("Indexer requires an API key");
}
if (errorMessage == "Request limit reached")
{
throw new RequestLimitReachedException("API limit reached");
}
throw new NewznabException("Newznab error detected: {0}", errorMessage);
}
}

@ -48,6 +48,10 @@ namespace NzbDrone.Core.Indexers
var apiKeyFailure = new ValidationFailure("ApiKey", "Invalid API Key");
throw new ValidationException(new List<ValidationFailure> {apiKeyFailure}.ToArray());
}
catch (RequestLimitReachedException)
{
_logger.Warn("Request limit reached");
}
catch (Exception ex)
{
_logger.WarnException("Indexer doesn't appear to be Newznab based: " + ex.Message, ex);

@ -299,6 +299,7 @@
<Compile Include="Indexers\BasicTorrentRssParser.cs" />
<Compile Include="Indexers\DownloadProtocols.cs" />
<Compile Include="Indexers\Exceptions\ApiKeyException.cs" />
<Compile Include="Indexers\Exceptions\RequestLimitReachedException.cs" />
<Compile Include="Indexers\Eztv\Eztv.cs" />
<Compile Include="Indexers\FetchAndParseRssService.cs" />
<Compile Include="Indexers\IIndexer.cs" />

Loading…
Cancel
Save