mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-29 08:10:51 +02:00
Fixed: (Cardigann) Throw exception only when all download selectors fail
This commit is contained in:
parent
20a3cad7fb
commit
660a162b7e
1 changed files with 5 additions and 9 deletions
|
|
@ -931,7 +931,7 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
|
||||
if (content.Length >= 1 && content[0] != 'd')
|
||||
{
|
||||
_logger.Debug("CardigannIndexer ({0}): Download selector {1}'s torrent file is invalid, retrying with next available selector", _definition.Id, querySelector);
|
||||
_logger.Debug("{0}: Download selector {1}'s torrent file is invalid, retrying with next available selector", _definition.Id, querySelector);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
@ -950,17 +950,13 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
|
||||
return selectorDownloadRequest;
|
||||
}
|
||||
catch (WebException ex) when (ex.Status == WebExceptionStatus.ProtocolError)
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Debug("{0} CardigannIndexer ({1}): An exception occurred while trying selector {2}, retrying with next available selector", ex, _definition.Id, querySelector);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error("{0} CardigannIndexer ({1}): An exception occurred while trying selector {2}, retrying with next available selector", e, _definition.Id, querySelector);
|
||||
|
||||
throw new CardigannException($"An exception occurred while trying selector: {querySelector}");
|
||||
_logger.Error(ex, "{0}: An exception occurred while trying selector {1}, retrying with next available selector.", _definition.Id, querySelector);
|
||||
}
|
||||
}
|
||||
|
||||
throw new CardigannException($"Download selectors didn't match for {link}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue