Skip to content

Commit

Permalink
Retry on HTTP timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Oct 8, 2023
1 parent 1e27e97 commit 6d29aae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MiniZip/BufferedRangeStream/RetryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public static async Task<T> RetryAsync<T>(Func<Exception, Task<T>> actAsync)
attempt++;
return await actAsync(lastException);
}
catch (Exception ex) when (ex is MiniZipHttpException || ex is IOException || ex is HttpRequestException)
catch (Exception ex) when (
ex is MiniZipHttpException
|| ex is IOException
|| ex is HttpRequestException
|| (ex is TaskCanceledException && ex.InnerException is TimeoutException))
{
lastException = ex;

Expand Down

0 comments on commit 6d29aae

Please sign in to comment.