Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Http2ProtocolException.cs
Go to the documentation of this file.
2
3namespace System.Net.Http;
4
6internal abstract class Http2ProtocolException : Exception
7{
9
11 : base(message)
12 {
14 }
15
17 : base(info, context)
18 {
19 ProtocolError = (Http2ProtocolErrorCode)info.GetInt32("ProtocolError");
20 }
21
23 {
24 info.AddValue("ProtocolError", (int)ProtocolError);
25 base.GetObjectData(info, context);
26 }
27
28 protected static string GetName(Http2ProtocolErrorCode code)
29 {
30 return code switch
31 {
32 Http2ProtocolErrorCode.NoError => "NO_ERROR",
33 Http2ProtocolErrorCode.ProtocolError => "PROTOCOL_ERROR",
34 Http2ProtocolErrorCode.InternalError => "INTERNAL_ERROR",
35 Http2ProtocolErrorCode.FlowControlError => "FLOW_CONTROL_ERROR",
36 Http2ProtocolErrorCode.SettingsTimeout => "SETTINGS_TIMEOUT",
37 Http2ProtocolErrorCode.StreamClosed => "STREAM_CLOSED",
38 Http2ProtocolErrorCode.FrameSizeError => "FRAME_SIZE_ERROR",
39 Http2ProtocolErrorCode.RefusedStream => "REFUSED_STREAM",
41 Http2ProtocolErrorCode.CompressionError => "COMPRESSION_ERROR",
42 Http2ProtocolErrorCode.ConnectError => "CONNECT_ERROR",
43 Http2ProtocolErrorCode.EnhanceYourCalm => "ENHANCE_YOUR_CALM",
44 Http2ProtocolErrorCode.InadequateSecurity => "INADEQUATE_SECURITY",
45 Http2ProtocolErrorCode.Http11Required => "HTTP_1_1_REQUIRED",
46 _ => "(unknown error)",
47 };
48 }
49}
Http2ProtocolException(string message, Http2ProtocolErrorCode protocolError)
override void GetObjectData(SerializationInfo info, StreamingContext context)
static string GetName(Http2ProtocolErrorCode code)
Http2ProtocolException(SerializationInfo info, StreamingContext context)