github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/fvm/errors/codes.go (about)

     1  package errors
     2  
     3  import "fmt"
     4  
     5  type ErrorCode uint16
     6  
     7  func (ec ErrorCode) String() string {
     8  	return fmt.Sprintf("[Error Code: %d]", ec)
     9  }
    10  
    11  type FailureCode uint16
    12  
    13  func (fc FailureCode) String() string {
    14  	return fmt.Sprintf("[Failure Code: %d]", fc)
    15  }
    16  
    17  const (
    18  	FailureCodeUnknownFailure     FailureCode = 2000
    19  	FailureCodeEncodingFailure    FailureCode = 2001
    20  	FailureCodeLedgerFailure      FailureCode = 2002
    21  	FailureCodeStateMergeFailure  FailureCode = 2003
    22  	FailureCodeBlockFinderFailure FailureCode = 2004
    23  	// Deprecated: No longer used.
    24  	FailureCodeHasherFailure                           FailureCode = 2005
    25  	FailureCodeParseRestrictedModeInvalidAccessFailure FailureCode = 2006
    26  	FailureCodePayerBalanceCheckFailure                FailureCode = 2007
    27  	FailureCodeDerivedDataCacheImplementationFailure   FailureCode = 2008
    28  	FailureCodeRandomSourceFailure                     FailureCode = 2009
    29  	FailureCodeEVMFailure                              FailureCode = 2010
    30  	// Deprecated: No longer used.
    31  	FailureCodeMetaTransactionFailure FailureCode = 2100
    32  )
    33  
    34  const (
    35  	// tx validation errors 1000 - 1049
    36  	// Deprecated: no longer in use
    37  	ErrCodeTxValidationError ErrorCode = 1000
    38  	// Deprecated: No longer used.
    39  	ErrCodeInvalidTxByteSizeError ErrorCode = 1001
    40  	// Deprecated: No longer used.
    41  	ErrCodeInvalidReferenceBlockError ErrorCode = 1002
    42  	// Deprecated: No longer used.
    43  	ErrCodeExpiredTransactionError ErrorCode = 1003
    44  	// Deprecated: No longer used.
    45  	ErrCodeInvalidScriptError ErrorCode = 1004
    46  	// Deprecated: No longer used.
    47  	ErrCodeInvalidGasLimitError          ErrorCode = 1005
    48  	ErrCodeInvalidProposalSignatureError ErrorCode = 1006
    49  	ErrCodeInvalidProposalSeqNumberError ErrorCode = 1007
    50  	ErrCodeInvalidPayloadSignatureError  ErrorCode = 1008
    51  	ErrCodeInvalidEnvelopeSignatureError ErrorCode = 1009
    52  
    53  	// base errors 1050 - 1100
    54  	// Deprecated: No longer used.
    55  	ErrCodeFVMInternalError            ErrorCode = 1050
    56  	ErrCodeValueError                  ErrorCode = 1051
    57  	ErrCodeInvalidArgumentError        ErrorCode = 1052
    58  	ErrCodeInvalidAddressError         ErrorCode = 1053
    59  	ErrCodeInvalidLocationError        ErrorCode = 1054
    60  	ErrCodeAccountAuthorizationError   ErrorCode = 1055
    61  	ErrCodeOperationAuthorizationError ErrorCode = 1056
    62  	ErrCodeOperationNotSupportedError  ErrorCode = 1057
    63  	ErrCodeBlockHeightOutOfRangeError  ErrorCode = 1058
    64  
    65  	// execution errors 1100 - 1200
    66  	// Deprecated: No longer used.
    67  	ErrCodeExecutionError      ErrorCode = 1100
    68  	ErrCodeCadenceRunTimeError ErrorCode = 1101
    69  	// Deprecated: No longer used.
    70  	ErrCodeEncodingUnsupportedValue ErrorCode = 1102
    71  	ErrCodeStorageCapacityExceeded  ErrorCode = 1103
    72  	// Deprecated: No longer used.
    73  	ErrCodeGasLimitExceededError                     ErrorCode = 1104
    74  	ErrCodeEventLimitExceededError                   ErrorCode = 1105
    75  	ErrCodeLedgerInteractionLimitExceededError       ErrorCode = 1106
    76  	ErrCodeStateKeySizeLimitError                    ErrorCode = 1107
    77  	ErrCodeStateValueSizeLimitError                  ErrorCode = 1108
    78  	ErrCodeTransactionFeeDeductionFailedError        ErrorCode = 1109
    79  	ErrCodeComputationLimitExceededError             ErrorCode = 1110
    80  	ErrCodeMemoryLimitExceededError                  ErrorCode = 1111
    81  	ErrCodeCouldNotDecodeExecutionParameterFromState ErrorCode = 1112
    82  	ErrCodeScriptExecutionTimedOutError              ErrorCode = 1113
    83  	ErrCodeScriptExecutionCancelledError             ErrorCode = 1114
    84  	ErrCodeEventEncodingError                        ErrorCode = 1115
    85  	ErrCodeInvalidInternalStateAccessError           ErrorCode = 1116
    86  	// 1117 was never deployed and is free to use
    87  	ErrCodeInsufficientPayerBalance ErrorCode = 1118
    88  
    89  	// accounts errors 1200 - 1250
    90  	// Deprecated: No longer used.
    91  	ErrCodeAccountError                  ErrorCode = 1200
    92  	ErrCodeAccountNotFoundError          ErrorCode = 1201
    93  	ErrCodeAccountPublicKeyNotFoundError ErrorCode = 1202
    94  	ErrCodeAccountAlreadyExistsError     ErrorCode = 1203
    95  	// Deprecated: No longer used.
    96  	ErrCodeFrozenAccountError ErrorCode = 1204
    97  	// Deprecated: No longer used.
    98  	ErrCodeAccountStorageNotInitializedError ErrorCode = 1205
    99  	ErrCodeAccountPublicKeyLimitError        ErrorCode = 1206
   100  
   101  	// contract errors 1250 - 1300
   102  	// Deprecated: No longer used.
   103  	ErrCodeContractError         ErrorCode = 1250
   104  	ErrCodeContractNotFoundError ErrorCode = 1251
   105  	// Deprecated: No longer used.
   106  	ErrCodeContractNamesNotFoundError ErrorCode = 1252
   107  
   108  	// fvm std lib errors 1300-1400
   109  	ErrEVMExecutionError ErrorCode = 1300
   110  )