mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: Do not prevent adding of indexer when API request limit was reached
This commit is contained in:
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 @@ public static void Process(string source, string url)
|
||||
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 @@ public void Test(IIndexer indexer)
|
||||
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…
Reference in New Issue
Block a user