4 instantiations of HttpProtocolException
System.Net.Http (4)
System\Net\Http\HttpProtocolException.cs (4)
42return new HttpProtocolException((long)protocolError, message, null); 48return new HttpProtocolException((long)protocolError, message, null); 54return new HttpProtocolException((long)protocolError, message, innerException); 60return new HttpProtocolException((long)protocolError, message, null);
63 references to HttpProtocolException
Interop.FunctionalTests (10)
Http3\Http3RequestTests.cs (5)
576var innerEx = Assert.IsType<HttpProtocolException>(ex.InnerException); 638var protocolException = ex.GetProtocolException(); 685var innerEx = Assert.IsType<HttpProtocolException>(ex.InnerException);
HttpClientHttp2InteropTests.cs (2)
743await Assert.ThrowsAsync<HttpProtocolException>(() => streamingContent.SendAsync("Hello World").DefaultTimeout()); 802await Assert.ThrowsAsync<HttpProtocolException>(() => streamingContent.SendAsync("Hello World").DefaultTimeout());
HttpHelpers.cs (3)
22public static HttpProtocolException GetProtocolException(this Exception ex) 27if (current is HttpProtocolException httpProtocolException) 35throw new Exception($"Couldn't find {nameof(HttpProtocolException)}. Original error: {ex}");
System.Net.Http (53)
System\Net\Http\HttpProtocolException.cs (7)
13/// When calling <see cref="HttpClient"/> or <see cref="SocketsHttpHandler"/> methods, <see cref="HttpProtocolException"/> will be the inner exception of 16/// <see cref="HttpContent.ReadAsStreamAsync(Threading.CancellationToken)"/>, <see cref="HttpProtocolException"/> can be thrown directly. 21/// Initializes a new instance of the <see cref="HttpProtocolException"/> class with the specified error code, 39internal static HttpProtocolException CreateHttp2StreamException(Http2ProtocolErrorCode protocolError) 45internal static HttpProtocolException CreateHttp2ConnectionException(Http2ProtocolErrorCode protocolError, string? message = null) 51internal static HttpProtocolException CreateHttp3StreamException(Http3ErrorCode protocolError, QuicException innerException) 57internal static HttpProtocolException CreateHttp3ConnectionException(Http3ErrorCode protocolError, string? message = null)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (4)
495catch (HttpProtocolException e) 1063http2Stream.OnReset(HttpProtocolException.CreateHttp2StreamException(protocolError), resetStreamErrorCode: protocolError, canRetry: canRetry); 1071Exception resetException = HttpProtocolException.CreateHttp2ConnectionException(errorCode, SR.net_http_http2_connection_close); 2175throw HttpProtocolException.CreateHttp2ConnectionException(errorCode, message);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (24)
365long connectionResetErrorCode = (abortException as HttpProtocolException)?.ErrorCode ?? (long)Http3ErrorCode.InternalError; 475Abort(HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream)); 486Abort(HttpProtocolException.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close)); 547Abort(HttpProtocolException.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close)); 569throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError); 604throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError); 620throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError); 631throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError); 642throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.IdError); 682Abort(HttpProtocolException.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close)); 711throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream); 716throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.MissingSettings); 734throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame); 746throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame); 750throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.IdError); 764throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream); 777throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream); 802throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError); 830throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError); 840throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError); 859throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.SettingsError); 881throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError); 889throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError); 910throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (18)
284HttpProtocolException rejectedException = HttpProtocolException.CreateHttp3StreamException(code, ex); 289Exception innerException = _connection.AbortException ?? HttpProtocolException.CreateHttp3StreamException(code, ex); 290HttpRequestError httpRequestError = innerException is HttpProtocolException ? HttpRequestError.HttpProtocolError : HttpRequestError.Unknown; 300Exception abortException = _connection.Abort(HttpProtocolException.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close)); 312HttpRequestError httpRequestError = _connection.AbortException is HttpProtocolException 340Exception abortException = _connection.Abort(HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.QPackDecompressionFailed)); 887throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame); 892throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.IdError); 976throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError); 992throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError); 998throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError); 1089throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError); 1127throw HttpProtocolException.CreateHttp3ConnectionException(Http3ErrorCode.FrameError); 1294throw HttpProtocolException.CreateHttp3StreamException((Http3ErrorCode)e.ApplicationErrorCode.Value, e); 1299HttpProtocolException exception = HttpProtocolException.CreateHttp3ConnectionException((Http3ErrorCode)e.ApplicationErrorCode.Value, SR.net_http_http3_connection_close); 1305HttpRequestError httpRequestError = _connection.AbortException is HttpProtocolException