File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . IO ;
2
3
using System . Linq ;
3
4
using System . Net ;
4
5
using System . Net . Http ;
@@ -20,7 +21,6 @@ public RetryPolicy(OctoLogger log)
20
21
_log = log ;
21
22
}
22
23
23
-
24
24
public async Task < HttpResponseMessage > HttpRetry ( Func < Task < HttpResponseMessage > > func )
25
25
{
26
26
var policy = Policy
@@ -82,7 +82,22 @@ public async Task<HttpResponseMessage> HttpRetry(Func<Task<HttpResponseMessage>>
82
82
{
83
83
var r = outcome . Result ;
84
84
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
+ }
86
101
87
102
_log ? . LogVerbose (
88
103
$ "Secondary rate limit (HTTP { ( int ) r . StatusCode } ). " +
You can’t perform that action at this time.
0 commit comments