102 references to HttpRequestError
System.Net.Http (101)
System\Net\Http\DiagnosticsHelper.cs (12)
84
Debug.Assert(Enum.GetValues<
HttpRequestError
>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError.");
87
HttpRequestError
.NameResolutionError => "name_resolution_error",
88
HttpRequestError
.ConnectionError => "connection_error",
89
HttpRequestError
.SecureConnectionError => "secure_connection_error",
90
HttpRequestError
.HttpProtocolError => "http_protocol_error",
91
HttpRequestError
.ExtendedConnectNotSupported => "extended_connect_not_supported",
92
HttpRequestError
.VersionNegotiationError => "version_negotiation_error",
93
HttpRequestError
.UserAuthenticationError => "user_authentication_error",
94
HttpRequestError
.ProxyTunnelError => "proxy_tunnel_error",
95
HttpRequestError
.InvalidResponse => "invalid_response",
96
HttpRequestError
.ResponseEnded => "response_ended",
97
HttpRequestError
.ConfigurationLimitExceeded => "configuration_limit_exceeded",
System\Net\Http\HttpContent.cs (3)
695
HttpRequestError
error = e is HttpIOException ioEx ? ioEx.HttpRequestError :
HttpRequestError
.Unknown;
768
return new HttpRequestException(
HttpRequestError
.ConfigurationLimitExceeded, SR.Format(CultureInfo.InvariantCulture, SR.net_http_content_buffersize_exceeded, maxBufferSize));
System\Net\Http\HttpIOException.cs (4)
16
/// <param name="httpRequestError">The <see cref="Http.
HttpRequestError
"/> that caused the exception.</param>
19
public HttpIOException(
HttpRequestError
httpRequestError, string? message = null, Exception? innerException = null)
26
/// Gets the <see cref="Http.
HttpRequestError
"/> that caused the exception.
28
public
HttpRequestError
HttpRequestError { get; }
System\Net\Http\HttpProtocolException.cs (1)
28
: base(Http.
HttpRequestError
.HttpProtocolError, message, innerException)
System\Net\Http\HttpRequestException.cs (4)
45
public HttpRequestException(
HttpRequestError
httpRequestError, string? message = null, Exception? inner = null, HttpStatusCode? statusCode = null)
52
/// Gets the <see cref="Http.
HttpRequestError
"/> that caused the exception.
54
public
HttpRequestError
HttpRequestError { get; }
66
internal HttpRequestException(
HttpRequestError
httpRequestError, string? message, Exception? inner, RequestRetryType allowRetry)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (1)
214
throw new HttpRequestException(
HttpRequestError
.UserAuthenticationError, SR.Format(SR.net_http_authvalidationfailure, statusCode), statusCode: HttpStatusCode.Unauthorized);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (5)
76
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _chunkBytesRemaining));
192
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _chunkBytesRemaining));
335
throw new HttpIOException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_chunk_header_invalid, BitConverter.ToString(currentLine.ToArray())));
389
throw new HttpIOException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_chunk_terminator_invalid, Encoding.ASCII.GetString(currentLine)));
452
throw new HttpIOException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_chunk_extension_invalid, BitConverter.ToString(lineAfterChunkSize.ToArray())));
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (5)
92
HttpRequestException ex = new HttpRequestException(
HttpRequestError
.SecureConnectionError, SR.net_http_ssl_connection_failed, e);
145
static
HttpRequestError
DeduceError(Exception exception)
149
return
HttpRequestError
.SecureConnectionError;
159
return
HttpRequestError
.NameResolutionError;
162
return
HttpRequestError
.ConnectionError;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (5)
470
HttpRequestException exception = new(
HttpRequestError
.ExtendedConnectNotSupported, SR.net_unsupported_extended_connect);
537
throw new HttpRequestException(
HttpRequestError
.VersionNegotiationError, SR.Format(SR.net_http_requested_version_server_refused, request.Version, request.VersionPolicy), e);
797
throw new HttpRequestException(
HttpRequestError
.ProxyTunnelError, SR.Format(SR.net_http_proxy_tunnel_returned_failure_status_code, _proxyUri, (int)tunnelResponse.StatusCode), statusCode: tunnelResponse.StatusCode);
824
throw new HttpRequestException(
HttpRequestError
.ProxyTunnelError, SR.net_http_proxy_tunnel_error, e);
871
HttpRequestException ex = new(
HttpRequestError
.VersionNegotiationError, SR.Format(SR.net_http_requested_version_cannot_establish, request.Version, request.VersionPolicy, desiredVersion), inner);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
277
throw new HttpRequestException(
HttpRequestError
.ConnectionError, "QUIC connected but no HTTP/3 indicated via ALPN.", null, RequestRetryType.RetryOnConnectionFailure);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (2)
41
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _contentBytesRemaining));
103
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _contentBytesRemaining));
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (6)
460
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, requiredBytes - _incomingBuffer.ActiveLength));
463
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.net_http_invalid_response_missing_frame);
503
InitialSettingsReceived.TrySetException(new HttpIOException(
HttpRequestError
.InvalidResponse, SR.net_http_http2_connection_not_established, e));
505
throw new HttpIOException(
HttpRequestError
.InvalidResponse, SR.net_http_http2_connection_not_established, e);
2058
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_client_execution_error, e);
2160
throw new HttpRequestException((innerException as HttpIOException)?.HttpRequestError ??
HttpRequestError
.Unknown, message, innerException, RequestRetryType.RetryOnConnectionFailure);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (8)
560
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response);
583
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response);
609
throw new HttpRequestException(
HttpRequestError
.ConfigurationLimitExceeded, SR.Format(SR.net_http_response_headers_exceeded_length, _connection._pool.Settings.MaxResponseHeadersByteLength));
631
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response_multiple_status_codes);
638
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response_pseudo_header_in_trailer);
701
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response);
745
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response);
754
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, Encoding.ASCII.GetString(name)));
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (3)
298
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_request_aborted, null, RequestRetryType.RetryOnConnectionFailure);
311
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_request_aborted, null, RequestRetryType.RetryOnConnectionFailure);
329
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_client_execution_error, _abortException, RequestRetryType.RetryOnConnectionFailure);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (25)
280
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_retry_on_older_version, ex, RequestRetryType.RetryOnLowerHttpVersion);
285
throw new HttpRequestException(
HttpRequestError
.HttpProtocolError, SR.net_http_request_aborted, rejectedException, RequestRetryType.RetryOnConnectionFailure);
290
HttpRequestError
httpRequestError = innerException is HttpProtocolException ?
HttpRequestError
.HttpProtocolError :
HttpRequestError
.Unknown;
301
throw new HttpRequestException(
HttpRequestError
.HttpProtocolError, SR.net_http_client_execution_error, abortException);
312
HttpRequestError
httpRequestError = _connection.AbortException is HttpProtocolException
313
?
HttpRequestError
.HttpProtocolError
314
:
HttpRequestError
.Unknown;
330
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_request_aborted, ex, RequestRetryType.RetryOnConnectionFailure);
341
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response, ex);
346
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_client_execution_error, ex);
358
throw new HttpRequestException(
HttpRequestError
.Unknown, SR.net_http_client_execution_error, ex);
395
throw new HttpIOException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response);
580
throw new HttpIOException(
HttpRequestError
.InvalidResponse, SR.net_http_invalid_response);
864
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.net_http_invalid_response_premature_eof);
908
throw new HttpRequestException(
HttpRequestError
.ConfigurationLimitExceeded, SR.Format(SR.net_http_response_headers_exceeded_length, _connection.Pool.Settings.MaxResponseHeadersByteLength));
927
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.net_http_invalid_response_premature_eof);
949
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, Encoding.ASCII.GetString(name)));
1187
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _responseDataPayloadRemaining));
1259
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _responseDataPayloadRemaining));
1305
HttpRequestError
httpRequestError = _connection.AbortException is HttpProtocolException
1306
?
HttpRequestError
.HttpProtocolError
1307
:
HttpRequestError
.Unknown;
1327
throw new HttpIOException(
HttpRequestError
.Unknown, SR.net_http_client_execution_error, new HttpRequestException(SR.net_http_client_execution_error, ex));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (15)
658
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.net_http_invalid_response_premature_eof);
932
HttpRequestError
error = ioe is HttpIOException httpIoe ? httpIoe.HttpRequestError :
HttpRequestError
.Unknown;
1065
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_line, Encoding.ASCII.GetString(line)));
1086
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_line, Encoding.ASCII.GetString(line)));
1094
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_code, Encoding.ASCII.GetString(line.Slice(9, 3))));
1119
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_reason, Encoding.ASCII.GetString(reasonBytes.ToArray())), formatEx);
1125
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_line, Encoding.ASCII.GetString(line)));
1224
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_line, Encoding.ASCII.GetString(buffer.Slice(0, newLineIndex))));
1323
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, ""));
1326
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, Encoding.ASCII.GetString(name)));
1330
throw new HttpRequestException(
HttpRequestError
.ConfigurationLimitExceeded, SR.Format(SR.net_http_response_headers_exceeded_length, _pool.Settings.MaxResponseHeadersByteLength));
1653
throw new HttpIOException(
HttpRequestError
.ResponseEnded, SR.net_http_invalid_response_premature_eof);
2073
throw new HttpRequestException(
HttpRequestError
.UserAuthenticationError, SR.net_http_authconnectionfailure);
2089
throw new HttpRequestException(
HttpRequestError
.UserAuthenticationError, SR.net_http_authconnectionfailure);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
185
throw new HttpRequestException(
HttpRequestError
.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_code, Encoding.ASCII.GetString(value)));
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
138
((ex.HttpRequestError ==
HttpRequestError
.ExtendedConnectNotSupported || ex.Data.Contains("HTTP2_ENABLED"))