Check response status code in classes that extend RssParser

pull/1643/head
Bogdan 2 years ago
parent cb189b8f61
commit 8bdc7a6db7

@ -54,6 +54,11 @@ namespace NzbDrone.Core.Indexers.Headphones
protected override bool PreProcess(IndexerResponse indexerResponse) protected override bool PreProcess(IndexerResponse indexerResponse)
{ {
if (indexerResponse.HttpResponse.HasHttpError)
{
base.PreProcess(indexerResponse);
}
var xdoc = LoadXmlDocument(indexerResponse); var xdoc = LoadXmlDocument(indexerResponse);
CheckError(xdoc, indexerResponse); CheckError(xdoc, indexerResponse);

@ -58,6 +58,11 @@ namespace NzbDrone.Core.Indexers.Newznab
protected override bool PreProcess(IndexerResponse indexerResponse) protected override bool PreProcess(IndexerResponse indexerResponse)
{ {
if (indexerResponse.HttpResponse.HasHttpError)
{
base.PreProcess(indexerResponse);
}
var xdoc = LoadXmlDocument(indexerResponse); var xdoc = LoadXmlDocument(indexerResponse);
CheckError(xdoc, indexerResponse); CheckError(xdoc, indexerResponse);

@ -28,6 +28,11 @@ namespace NzbDrone.Core.Indexers.Torznab
protected override bool PreProcess(IndexerResponse indexerResponse) protected override bool PreProcess(IndexerResponse indexerResponse)
{ {
if (indexerResponse.HttpResponse.HasHttpError)
{
base.PreProcess(indexerResponse);
}
var xdoc = LoadXmlDocument(indexerResponse); var xdoc = LoadXmlDocument(indexerResponse);
var error = xdoc.Descendants("error").FirstOrDefault(); var error = xdoc.Descendants("error").FirstOrDefault();

@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using System.Xml.Linq; using System.Xml.Linq;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Indexers.Exceptions; using NzbDrone.Core.Indexers.Exceptions;
@ -16,6 +16,11 @@ namespace NzbDrone.Core.Indexers
protected override bool PreProcess(IndexerResponse indexerResponse) protected override bool PreProcess(IndexerResponse indexerResponse)
{ {
if (indexerResponse.HttpResponse.HasHttpError)
{
base.PreProcess(indexerResponse);
}
var document = LoadXmlDocument(indexerResponse); var document = LoadXmlDocument(indexerResponse);
var items = GetItems(document).ToList(); var items = GetItems(document).ToList();
@ -24,7 +29,7 @@ namespace NzbDrone.Core.Indexers
throw new IndexerException(indexerResponse, "No results were found"); throw new IndexerException(indexerResponse, "No results were found");
} }
return base.PreProcess(indexerResponse); return true;
} }
protected override long GetSize(XElement item) protected override long GetSize(XElement item)

Loading…
Cancel
Save