Fixed: (Newznab Torznab) Better HTTP Error Handling

This commit is contained in:
Bakerboy448 2023-05-18 10:48:29 -05:00
parent 474f5f29ca
commit 36bc36eafc
1 changed files with 7 additions and 6 deletions

View File

@ -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)
{ {