Skip to content

Commit d6e84e0

Browse files
committed
Linter errors
1 parent 8015a18 commit d6e84e0

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/Octoshift/RetryPolicy.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.IO;
23
using System.Linq;
34
using System.Net;
45
using System.Net.Http;
@@ -20,7 +21,6 @@ public RetryPolicy(OctoLogger log)
2021
_log = log;
2122
}
2223

23-
2424
public async Task<HttpResponseMessage> HttpRetry(Func<Task<HttpResponseMessage>> func)
2525
{
2626
var policy = Policy
@@ -82,7 +82,22 @@ public async Task<HttpResponseMessage> HttpRetry(Func<Task<HttpResponseMessage>>
8282
{
8383
var r = outcome.Result;
8484
string body = null;
85-
try { body = r.Content != null ? await r.Content.ReadAsStringAsync() : null; } catch { /* ignore */ }
85+
try
86+
{
87+
body = r.Content != null ? await r.Content.ReadAsStringAsync() : null;
88+
}
89+
catch (IOException)
90+
{
91+
// ignored
92+
}
93+
catch (ObjectDisposedException)
94+
{
95+
// ignored
96+
}
97+
catch (InvalidOperationException)
98+
{
99+
// ignored
100+
}
86101

87102
_log?.LogVerbose(
88103
$"Secondary rate limit (HTTP {(int)r.StatusCode}). " +

0 commit comments

Comments
 (0)