Fixed: (Newznab Torznab) Better HTTP Error Handling
This commit is contained in:
parent
474f5f29ca
commit
36bc36eafc
|
@ -121,7 +121,8 @@ namespace NzbDrone.Core.Indexers
|
||||||
|
|
||||||
protected virtual bool PreProcess(IndexerResponse indexerResponse)
|
protected virtual bool PreProcess(IndexerResponse indexerResponse)
|
||||||
{
|
{
|
||||||
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
|
// Server Down HTTP Errors are handled in HTTPIndexerBase so ignore them here
|
||||||
|
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK && !indexerResponse.HttpResponse.HasHttpServerError)
|
||||||
{
|
{
|
||||||
throw new IndexerException(indexerResponse, "Indexer API call resulted in an unexpected StatusCode [{0}]", indexerResponse.HttpResponse.StatusCode);
|
throw new IndexerException(indexerResponse, "Indexer API call resulted in an unexpected StatusCode [{0}]", indexerResponse.HttpResponse.StatusCode);
|
||||||
}
|
}
|
||||||
|
@ -266,11 +267,11 @@ namespace NzbDrone.Core.Indexers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return new RssEnclosure
|
return new RssEnclosure
|
||||||
{
|
{
|
||||||
Url = v.Attribute("url")?.Value,
|
Url = v.Attribute("url")?.Value,
|
||||||
Type = v.Attribute("type")?.Value,
|
Type = v.Attribute("type")?.Value,
|
||||||
Length = v.Attribute("length")?.Value?.ParseInt64() ?? 0
|
Length = v.Attribute("length")?.Value?.ParseInt64() ?? 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue