github.com/tumi8/quic-go@v0.37.4-tum/http3/error_codes.go (about) 1 package http3 2 3 import ( 4 "fmt" 5 6 quic "github.com/tumi8/quic-go" 7 ) 8 9 type ErrCode quic.ApplicationErrorCode 10 11 const ( 12 ErrCodeNoError ErrCode = 0x100 13 ErrCodeGeneralProtocolError ErrCode = 0x101 14 ErrCodeInternalError ErrCode = 0x102 15 ErrCodeStreamCreationError ErrCode = 0x103 16 ErrCodeClosedCriticalStream ErrCode = 0x104 17 ErrCodeFrameUnexpected ErrCode = 0x105 18 ErrCodeFrameError ErrCode = 0x106 19 ErrCodeExcessiveLoad ErrCode = 0x107 20 ErrCodeIDError ErrCode = 0x108 21 ErrCodeSettingsError ErrCode = 0x109 22 ErrCodeMissingSettings ErrCode = 0x10a 23 ErrCodeRequestRejected ErrCode = 0x10b 24 ErrCodeRequestCanceled ErrCode = 0x10c 25 ErrCodeRequestIncomplete ErrCode = 0x10d 26 ErrCodeMessageError ErrCode = 0x10e 27 ErrCodeConnectError ErrCode = 0x10f 28 ErrCodeVersionFallback ErrCode = 0x110 29 ErrCodeDatagramError ErrCode = 0x4a1268 30 ) 31 32 func (e ErrCode) String() string { 33 switch e { 34 case ErrCodeNoError: 35 return "H3_NO_ERROR" 36 case ErrCodeGeneralProtocolError: 37 return "H3_GENERAL_PROTOCOL_ERROR" 38 case ErrCodeInternalError: 39 return "H3_INTERNAL_ERROR" 40 case ErrCodeStreamCreationError: 41 return "H3_STREAM_CREATION_ERROR" 42 case ErrCodeClosedCriticalStream: 43 return "H3_CLOSED_CRITICAL_STREAM" 44 case ErrCodeFrameUnexpected: 45 return "H3_FRAME_UNEXPECTED" 46 case ErrCodeFrameError: 47 return "H3_FRAME_ERROR" 48 case ErrCodeExcessiveLoad: 49 return "H3_EXCESSIVE_LOAD" 50 case ErrCodeIDError: 51 return "H3_ID_ERROR" 52 case ErrCodeSettingsError: 53 return "H3_SETTINGS_ERROR" 54 case ErrCodeMissingSettings: 55 return "H3_MISSING_SETTINGS" 56 case ErrCodeRequestRejected: 57 return "H3_REQUEST_REJECTED" 58 case ErrCodeRequestCanceled: 59 return "H3_REQUEST_CANCELLED" 60 case ErrCodeRequestIncomplete: 61 return "H3_INCOMPLETE_REQUEST" 62 case ErrCodeMessageError: 63 return "H3_MESSAGE_ERROR" 64 case ErrCodeConnectError: 65 return "H3_CONNECT_ERROR" 66 case ErrCodeVersionFallback: 67 return "H3_VERSION_FALLBACK" 68 case ErrCodeDatagramError: 69 return "H3_DATAGRAM_ERROR" 70 default: 71 return fmt.Sprintf("unknown error code: %#x", uint16(e)) 72 } 73 }