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