1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-26 09:48:37 +00:00

core: Fix exception when no result is returned from web request (#11371) for #11358

This commit is contained in:
6cUbi57z 2021-03-27 04:36:57 +00:00 committed by GitHub
parent 7114baa609
commit 4ec6110671
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -461,7 +461,14 @@ namespace Jackett.Common.Indexers
retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt) / 4),
onRetry: (exception, timeSpan, context) =>
{
logger.Warn($"Request to {DisplayName} failed with status {exception.Result.Status}. Retrying in {timeSpan.TotalSeconds}s... (Attempt {attemptNumber} of {NumberOfRetryAttempts}).");
if (exception.Result == null)
{
logger.Warn($"Request to {DisplayName} failed with exception '{exception.Exception.Message}'. Retrying in {timeSpan.TotalSeconds}s... (Attempt {attemptNumber} of {NumberOfRetryAttempts}).");
}
else
{
logger.Warn($"Request to {DisplayName} failed with status {exception.Result.Status}. Retrying in {timeSpan.TotalSeconds}s... (Attempt {attemptNumber} of {NumberOfRetryAttempts}).");
}
attemptNumber++;
});
return retryPolicy;