# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""HTTP/2 Error Code=======================.. module:: pcapkit.const.http.error_codeThis module contains the constant enumeration for **HTTP/2 Error Code**,which is automatically generated from :class:`pcapkit.vendor.http.error_code.ErrorCode`."""fromaenumimportIntEnum,extend_enum__all__=['ErrorCode']
[docs]classErrorCode(IntEnum):"""[ErrorCode] HTTP/2 Error Code"""#: NO_ERROR, Graceful shutdown [:rfc:`9113#section-7`]NO_ERROR=0x00000000#: PROTOCOL_ERROR, Protocol error detected [:rfc:`9113#section-7`]PROTOCOL_ERROR=0x00000001#: INTERNAL_ERROR, Implementation fault [:rfc:`9113#section-7`]INTERNAL_ERROR=0x00000002#: FLOW_CONTROL_ERROR, Flow-control limits exceeded [:rfc:`9113#section-7`]FLOW_CONTROL_ERROR=0x00000003#: SETTINGS_TIMEOUT, Settings not acknowledged [:rfc:`9113#section-7`]SETTINGS_TIMEOUT=0x00000004#: STREAM_CLOSED, Frame received for closed stream [:rfc:`9113#section-7`]STREAM_CLOSED=0x00000005#: FRAME_SIZE_ERROR, Frame size incorrect [:rfc:`9113#section-7`]FRAME_SIZE_ERROR=0x00000006#: REFUSED_STREAM, Stream not processed [:rfc:`9113#section-7`]REFUSED_STREAM=0x00000007#: CANCEL, Stream cancelled [:rfc:`9113#section-7`]CANCEL=0x00000008#: COMPRESSION_ERROR, Compression state not updated [:rfc:`9113#section-7`]COMPRESSION_ERROR=0x00000009#: CONNECT_ERROR, TCP connection error for CONNECT method#: [:rfc:`9113#section-7`]CONNECT_ERROR=0x0000000A#: ENHANCE_YOUR_CALM, Processing capacity exceeded [:rfc:`9113#section-7`]ENHANCE_YOUR_CALM=0x0000000B#: INADEQUATE_SECURITY, Negotiated TLS parameters not acceptable#: [:rfc:`9113#section-7`]INADEQUATE_SECURITY=0x0000000C#: HTTP_1_1_REQUIRED, Use HTTP/1.1 for the request [:rfc:`9113#section-7`]HTTP_1_1_REQUIRED=0x0000000D@staticmethoddefget(key:'int | str',default:'int'=-1)->'ErrorCode':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnErrorCode(key)ifkeynotinErrorCode._member_map_:# pylint: disable=no-memberreturnextend_enum(ErrorCode,key,default)returnErrorCode[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'ErrorCode':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0x00000000<=value<=0xFFFFFFFF):raiseValueError('%r is not a valid %s'%(value,cls.__name__))if0x0000000E<=value<=0xFFFFFFFF:#: Unassignedtemp=hex(value)[2:].upper().zfill(8)returnextend_enum(cls,'Unassigned_0x%s'%(temp[:4]+'_'+temp[4:]),value)returnsuper()._missing_(value)