mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-17 10:20:48 +02:00
Treat unauthorized newbie accounts in AvistaZ parser
This commit is contained in:
parent
951d42a591
commit
c05be39346
1 changed files with 6 additions and 0 deletions
|
|
@ -33,6 +33,12 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
throw new RequestLimitReachedException(indexerResponse, "API Request Limit Reached");
|
||||
}
|
||||
|
||||
if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.Unauthorized)
|
||||
{
|
||||
STJson.TryDeserialize<AvistazErrorResponse>(indexerResponse.HttpResponse.Content, out var errorResponse);
|
||||
throw new IndexerAuthException(errorResponse?.Message ?? "Unauthorized request to indexer");
|
||||
}
|
||||
|
||||
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
throw new IndexerException(indexerResponse, $"Unexpected response status {indexerResponse.HttpResponse.StatusCode} code from indexer request");
|
||||
|
|
|
|||
Loading…
Reference in a new issue