Skip to content

Commit

Permalink
forward innerException's error code to retryable HttpRequestException (
Browse files Browse the repository at this point in the history
…#89963)

If we are doing a retry because of a protocol error, or some other HttpIOException, we should forward the error code to the retryable HttpRequestException
  • Loading branch information
antonfirsov authored Aug 3, 2023
1 parent 9d32dd6 commit b9c1129
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ internal void Trace(int streamId, string message, [CallerMemberName] string? mem

[DoesNotReturn]
private static void ThrowRetry(string message, Exception? innerException = null) =>
throw new HttpRequestException(HttpRequestError.Unknown, message, innerException, RequestRetryType.RetryOnConnectionFailure);
throw new HttpRequestException((innerException as HttpIOException)?.HttpRequestError ?? HttpRequestError.Unknown, message, innerException, RequestRetryType.RetryOnConnectionFailure);

private static Exception GetRequestAbortedException(Exception? innerException = null) =>
innerException as HttpIOException ?? new IOException(SR.net_http_request_aborted, innerException);
Expand Down

0 comments on commit b9c1129

Please sign in to comment.