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)
495
catch (
HttpProtocolException
e)
1063
http2Stream.OnReset(
HttpProtocolException
.CreateHttp2StreamException(protocolError), resetStreamErrorCode: protocolError, canRetry: canRetry);
1071
Exception resetException =
HttpProtocolException
.CreateHttp2ConnectionException(errorCode, SR.net_http_http2_connection_close);
2175
throw
HttpProtocolException
.CreateHttp2ConnectionException(errorCode, message);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (24)
365
long connectionResetErrorCode = (abortException as
HttpProtocolException
)?.ErrorCode ?? (long)Http3ErrorCode.InternalError;
475
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream));
486
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
547
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
569
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
604
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
620
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
631
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.StreamCreationError);
642
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.IdError);
682
Abort(
HttpProtocolException
.CreateHttp3ConnectionException(code, SR.net_http_http3_connection_close));
711
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
716
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.MissingSettings);
734
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame);
746
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.UnexpectedFrame);
750
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.IdError);
764
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
777
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
802
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
830
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
840
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
859
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.SettingsError);
881
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
889
throw
HttpProtocolException
.CreateHttp3ConnectionException(Http3ErrorCode.FrameError);
910
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