@@ -9,20 +9,20 @@ class ErrorCode(IntEnum):
9
9
ErrorCode = vars ()
10
10
11
11
# HTTP/2 Error Code
12
- ErrorCode ['NO_ERROR' ] = 0x0000_0000 # [RFC 7540, Section 7] Graceful shutdown
13
- ErrorCode ['PROTOCOL_ERROR' ] = 0x0000_0001 # [RFC 7540, Section 7] Protocol error detected
14
- ErrorCode ['INTERNAL_ERROR' ] = 0x0000_0002 # [RFC 7540, Section 7] Implementation fault
15
- ErrorCode ['FLOW_CONTROL_ERROR' ] = 0x0000_0003 # [RFC 7540, Section 7] Flow-control limits exceeded
16
- ErrorCode ['SETTINGS_TIMEOUT' ] = 0x0000_0004 # [RFC 7540, Section 7] Settings not acknowledged
17
- ErrorCode ['STREAM_CLOSED' ] = 0x0000_0005 # [RFC 7540, Section 7] Frame received for closed stream
18
- ErrorCode ['FRAME_SIZE_ERROR' ] = 0x0000_0006 # [RFC 7540, Section 7] Frame size incorrect
19
- ErrorCode ['REFUSED_STREAM' ] = 0x0000_0007 # [RFC 7540, Section 7] Stream not processed
20
- ErrorCode ['CANCEL' ] = 0x0000_0008 # [RFC 7540, Section 7] Stream cancelled
21
- ErrorCode ['COMPRESSION_ERROR' ] = 0x0000_0009 # [RFC 7540, Section 7] Compression state not updated
22
- ErrorCode ['CONNECT_ERROR' ] = 0x0000_000A # [RFC 7540, Section 7] TCP connection error for CONNECT method
23
- ErrorCode ['ENHANCE_YOUR_CALM' ] = 0x0000_000B # [RFC 7540, Section 7] Processing capacity exceeded
24
- ErrorCode ['INADEQUATE_SECURITY' ] = 0x0000_000C # [RFC 7540, Section 7] Negotiated TLS parameters not acceptable
25
- ErrorCode ['HTTP_1_1_REQUIRED' ] = 0x0000_000D # [RFC 7540, Section 7] Use HTTP/1.1 for the request
12
+ ErrorCode ['NO_ERROR' ] = 0x00000000 # [RFC 7540, Section 7] Graceful shutdown
13
+ ErrorCode ['PROTOCOL_ERROR' ] = 0x00000001 # [RFC 7540, Section 7] Protocol error detected
14
+ ErrorCode ['INTERNAL_ERROR' ] = 0x00000002 # [RFC 7540, Section 7] Implementation fault
15
+ ErrorCode ['FLOW_CONTROL_ERROR' ] = 0x00000003 # [RFC 7540, Section 7] Flow-control limits exceeded
16
+ ErrorCode ['SETTINGS_TIMEOUT' ] = 0x00000004 # [RFC 7540, Section 7] Settings not acknowledged
17
+ ErrorCode ['STREAM_CLOSED' ] = 0x00000005 # [RFC 7540, Section 7] Frame received for closed stream
18
+ ErrorCode ['FRAME_SIZE_ERROR' ] = 0x00000006 # [RFC 7540, Section 7] Frame size incorrect
19
+ ErrorCode ['REFUSED_STREAM' ] = 0x00000007 # [RFC 7540, Section 7] Stream not processed
20
+ ErrorCode ['CANCEL' ] = 0x00000008 # [RFC 7540, Section 7] Stream cancelled
21
+ ErrorCode ['COMPRESSION_ERROR' ] = 0x00000009 # [RFC 7540, Section 7] Compression state not updated
22
+ ErrorCode ['CONNECT_ERROR' ] = 0x0000000A # [RFC 7540, Section 7] TCP connection error for CONNECT method
23
+ ErrorCode ['ENHANCE_YOUR_CALM' ] = 0x0000000B # [RFC 7540, Section 7] Processing capacity exceeded
24
+ ErrorCode ['INADEQUATE_SECURITY' ] = 0x0000000C # [RFC 7540, Section 7] Negotiated TLS parameters not acceptable
25
+ ErrorCode ['HTTP_1_1_REQUIRED' ] = 0x0000000D # [RFC 7540, Section 7] Use HTTP/1.1 for the request
26
26
27
27
@staticmethod
28
28
def get (key , default = - 1 ):
@@ -38,7 +38,7 @@ def _missing_(cls, value):
38
38
"""Lookup function used when value is not found."""
39
39
if not (isinstance (value , int ) and 0x0000_0000 <= value <= 0xFFFF_FFFF ):
40
40
raise ValueError ('%r is not a valid %s' % (value , cls .__name__ ))
41
- if 0x0000_000E <= value <= 0xFFFF_FFFF :
41
+ if 0x0000000E <= value <= 0xFFFFFFFF :
42
42
temp = hex (value )[2 :].upper ().zfill (8 )
43
43
extend_enum (cls , 'Unassigned [0x%s]' % (temp [:4 ]+ '_' + temp [4 :]), value )
44
44
return cls (value )
0 commit comments