4 instantiations of HttpProtocolException
System.Net.Http (4)
System\Net\Http\HttpProtocolException.cs (4)
42
return new
HttpProtocolException
((long)protocolError, message, null);
48
return new
HttpProtocolException
((long)protocolError, message, null);
54
return new
HttpProtocolException
((long)protocolError, message, innerException);
60
return new
HttpProtocolException
((long)protocolError, message, null);
63 references to HttpProtocolException
Interop.FunctionalTests (10)
Http3\Http3RequestTests.cs (5)
576
var
innerEx = Assert.IsType<
HttpProtocolException
>(ex.InnerException);
638
var
protocolException = ex.GetProtocolException();
685
var
innerEx = Assert.IsType<
HttpProtocolException
>(ex.InnerException);
HttpClientHttp2InteropTests.cs (2)
743
await Assert.ThrowsAsync<
HttpProtocolException
>(() => streamingContent.SendAsync("Hello World").DefaultTimeout());
802
await Assert.ThrowsAsync<
HttpProtocolException
>(() => streamingContent.SendAsync("Hello World").DefaultTimeout());
HttpHelpers.cs (3)
22
public static
HttpProtocolException
GetProtocolException(this Exception ex)
27
if (current is
HttpProtocolException
httpProtocolException)
35
throw 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,
39
internal static
HttpProtocolException
CreateHttp2StreamException(Http2ProtocolErrorCode protocolError)
45
internal static
HttpProtocolException
CreateHttp2ConnectionException(Http2ProtocolErrorCode protocolError, string? message = null)
51
internal static
HttpProtocolException
CreateHttp3StreamException(Http3ErrorCode protocolError, QuicException innerException)
57
internal static
HttpProtocolException
CreateHttp3ConnectionException(Http3ErrorCode protocolError, string? message = null)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (4)
504
catch (
HttpProtocolException
e)
1072
http2Stream.OnReset(
HttpProtocolException
.CreateHttp2StreamException(protocolError), resetStreamErrorCode: protocolError, canRetry: canRetry);
1080
Exception resetException =
HttpProtocolException
.CreateHttp2ConnectionException(errorCode, SR.net_http_http2_connection_close);
2184
throw
HttpProtocolException
.CreateHttp2ConnectionException(errorCode, message);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (24)
371
long connectionResetErrorCode = (abortException as
HttpProtocolException
)?.ErrorCode ?? (long)Http3ErrorCode.InternalError;
483
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream));
494
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
555
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
577
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
612
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
628
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
639
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
650
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.IdError);
690
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
719
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
724
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.MissingSettings);
742
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame);
754
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame);
758
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.IdError);
772
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
785
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
810
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
838
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
848
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
867
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.SettingsError);
889
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
897
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
918
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (18)
284
HttpProtocolException
rejectedException =
HttpProtocolException
.CreateHttp3StreamException(code, ex);
289
Exception innerException = _connection.AbortException ??
HttpProtocolException
.CreateHttp3StreamException(code, ex);
290
HttpRequestError httpRequestError = innerException is
HttpProtocolException
? HttpRequestError.HttpProtocolError : HttpRequestError.Unknown;
300
Exception abortException = _connection.Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
312
HttpRequestError httpRequestError = _connection.AbortException is
HttpProtocolException
340
Exception abortException = _connection.Abort(
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.QPackDecompressionFailed));
887
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame);
892
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.IdError);
976
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError);
992
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError);
998
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError);
1089
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ProtocolError);
1127
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
1294
throw
HttpProtocolException
.CreateHttp3StreamException((Http3ErrorCode)e.ApplicationErrorCode.Value, e);
1299
HttpProtocolException
exception =
HttpProtocolException
.CreateHttp3ConnectionException((Http3ErrorCode)e.ApplicationErrorCode.Value, SR.net_http_http3_connection_close);
1305
HttpRequestError httpRequestError = _connection.AbortException is
HttpProtocolException