92 instantiations of HttpRequestException
Aspire.Cli.Tests (2)
Aspire.Hosting.Azure (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Resilience.Tests (6)
System.Net.Http (78)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (8)
460HttpRequestException exception = new(HttpRequestError.ExtendedConnectNotSupported, SR.net_unsupported_extended_connect);
527throw new HttpRequestException(HttpRequestError.VersionNegotiationError, SR.Format(SR.net_http_requested_version_server_refused, request.Version, request.VersionPolicy), e);
674stream = await streamTask.ConfigureAwait(false) ?? throw new HttpRequestException(SR.net_http_null_from_connect_callback);
763throw new HttpRequestException(SR.net_http_exception_during_plaintext_filter, e);
769throw new HttpRequestException(SR.net_http_null_from_plaintext_filter);
791throw new HttpRequestException(HttpRequestError.ProxyTunnelError, SR.Format(SR.net_http_proxy_tunnel_returned_failure_status_code, _proxyUri, (int)tunnelResponse.StatusCode), statusCode: tunnelResponse.StatusCode);
818throw new HttpRequestException(HttpRequestError.ProxyTunnelError, SR.net_http_proxy_tunnel_error, e);
865HttpRequestException ex = new(HttpRequestError.VersionNegotiationError, SR.Format(SR.net_http_requested_version_cannot_establish, request.Version, request.VersionPolicy, desiredVersion), inner);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (5)
1586throw new HttpRequestException(SR.Format(SR.net_http_request_headers_exceeded_length, maxHeaderListSize));
2090throw new HttpRequestException(HttpRequestError.UserAuthenticationError, SR.net_http_authconnectionfailure, null, RequestRetryType.RetryOnSessionAuthenticationChallenge);
2098throw new HttpRequestException(e.HttpRequestError, e.Message, e);
2102throw new HttpRequestException(HttpRequestError.Unknown, SR.net_http_client_execution_error, e);
2204throw new HttpRequestException((innerException as HttpIOException)?.HttpRequestError ?? HttpRequestError.Unknown, message, innerException, RequestRetryType.RetryOnConnectionFailure);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (10)
232throw new HttpRequestException(SR.Format(SR.net_http_request_content_length_mismatch, writeStream.BytesWritten, writeStream.ContentLength));
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)));
1537return ValueTask.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new HttpRequestException(SR.net_http_content_write_larger_than_content_length)));
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (18)
300throw new HttpRequestException(HttpRequestError.Unknown, SR.net_http_retry_on_older_version, ex, RequestRetryType.RetryOnLowerHttpVersion);
305throw new HttpRequestException(HttpRequestError.HttpProtocolError, SR.net_http_request_aborted, rejectedException, RequestRetryType.RetryOnConnectionFailure);
311throw new HttpRequestException(httpRequestError, SR.net_http_client_execution_error, innerException);
321throw new HttpRequestException(HttpRequestError.HttpProtocolError, SR.net_http_client_execution_error, abortException);
336throw new HttpRequestException(httpRequestError, SR.net_http_client_execution_error, _connection.AbortException);
342throw new HttpRequestException(HttpRequestError.Unknown, SR.net_http_http3_connection_quic_error, ex);
356throw new HttpRequestException(HttpRequestError.Unknown, SR.net_http_request_aborted, ex, RequestRetryType.RetryOnConnectionFailure);
362throw new HttpRequestException(ex.HttpRequestError, SR.net_http_client_execution_error, ex);
367throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.net_http_invalid_response, ex);
372throw new HttpRequestException(HttpRequestError.Unknown, SR.net_http_client_execution_error, ex);
384throw new HttpRequestException(HttpRequestError.Unknown, SR.net_http_client_execution_error, ex);
496throw new HttpRequestException(SR.Format(SR.net_http_request_content_length_mismatch, sent, contentLength));
547throw new HttpRequestException(SR.net_http_content_write_larger_than_content_length);
764throw new HttpRequestException(SR.Format(SR.net_http_request_headers_exceeded_length, maxHeaderListSize));
966throw new HttpRequestException(HttpRequestError.ConfigurationLimitExceeded, SR.Format(SR.net_http_response_headers_exceeded_length, _connection.Pool.Settings.MaxResponseHeadersByteLength));
1007throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, Encoding.ASCII.GetString(name)));
1366throw new HttpRequestException(httpRequestError, SR.net_http_client_execution_error, _connection.AbortException);
1385throw 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 (16)
322throw new HttpRequestException(SR.net_http_request_no_host);
529throw new HttpRequestException(SR.net_http_request_invalid_char_encoding);
926mappedException = new HttpRequestException(SR.net_http_client_execution_error, exception);
935mappedException = new HttpRequestException(error, SR.net_http_client_execution_error, ioe, _canRetry ? RequestRetryType.RetryOnConnectionFailure : RequestRetryType.NoRetry);
1067throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_line, Encoding.ASCII.GetString(line)));
1088throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_line, Encoding.ASCII.GetString(line)));
1096throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_code, Encoding.ASCII.GetString(line.Slice(9, 3))));
1121throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_reason, Encoding.ASCII.GetString(reasonBytes.ToArray())), formatEx);
1127throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_status_line, Encoding.ASCII.GetString(line)));
1226throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_line, Encoding.ASCII.GetString(buffer.Slice(0, newLineIndex))));
1325throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, ""));
1328throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_name, Encoding.ASCII.GetString(name)));
1332throw new HttpRequestException(HttpRequestError.ConfigurationLimitExceeded, SR.Format(SR.net_http_response_headers_exceeded_length, _pool.Settings.MaxResponseHeadersByteLength));
1620throw new HttpRequestException(SR.net_http_chunk_too_large);
2080throw new HttpRequestException(HttpRequestError.UserAuthenticationError, SR.net_http_authconnectionfailure);
2096throw new HttpRequestException(HttpRequestError.UserAuthenticationError, SR.net_http_authconnectionfailure);
System.Net.Http.Json (1)
System.Net.Http.WinHttpHandler (1)
83 references to HttpRequestException
aspire (8)
Aspire.Cli.Tests (1)
Aspire.Hosting (2)
Aspire.Hosting.Azure.Tests (2)
dotnet (2)
dotnet-svcutil-lib (3)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Microsoft.Build.Tasks.Core (2)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.Extensions.Http (4)
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Microsoft.Extensions.Http.Resilience (4)
Microsoft.Extensions.Http.Resilience.PerformanceTests (2)
Microsoft.Extensions.Http.Resilience.Tests (2)
Microsoft.NET.Build.Containers (4)
Microsoft.NET.Sdk.Publish.Tasks (2)
netstandard (1)
NuGet.PackageManagement (2)
NuGet.Protocol (3)
System.Net.Http (23)
System.Net.Requests (3)
System.ServiceModel.Http (3)