mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-28 07:40:50 +02:00
parent
e383036c84
commit
561563b48c
2 changed files with 6 additions and 5 deletions
|
|
@ -24,6 +24,11 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
{
|
||||
var torrentInfos = new List<TorrentInfo>();
|
||||
|
||||
if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.NotFound)
|
||||
{
|
||||
return torrentInfos.ToArray();
|
||||
}
|
||||
|
||||
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
throw new IndexerException(indexerResponse, $"Unexpected response status {indexerResponse.HttpResponse.StatusCode} code from API request");
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ protected virtual async Task<IndexerResponse> FetchIndexerResponse(IndexerReques
|
|||
response = await _httpClient.ExecuteAsync(request.HttpRequest);
|
||||
}
|
||||
|
||||
// Throw any other http error we get after attempting auth
|
||||
// Throw common http errors here before we try to parse
|
||||
if (response.HasHttpError)
|
||||
{
|
||||
_logger.Warn("HTTP Error - {0}", response);
|
||||
|
|
@ -450,10 +450,6 @@ protected virtual async Task<IndexerResponse> FetchIndexerResponse(IndexerReques
|
|||
{
|
||||
throw new TooManyRequestsException(request.HttpRequest, response);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new HttpException(request.HttpRequest, response);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateCookies(Cookies, DateTime.Now + TimeSpan.FromDays(30));
|
||||
|
|
|
|||
Loading…
Reference in a new issue