github.com/cosmos/cosmos-sdk@v0.50.10/types/errors/errors.go (about) 1 package errors 2 3 import ( 4 errorsmod "cosmossdk.io/errors" 5 ) 6 7 // RootCodespace is the codespace for all errors defined in this package 8 const RootCodespace = "sdk" 9 10 var ( 11 // ErrTxDecode is returned if we cannot parse a transaction 12 ErrTxDecode = errorsmod.Register(RootCodespace, 2, "tx parse error") 13 14 // ErrInvalidSequence is used the sequence number (nonce) is incorrect 15 // for the signature 16 ErrInvalidSequence = errorsmod.Register(RootCodespace, 3, "invalid sequence") 17 18 // ErrUnauthorized is used whenever a request without sufficient 19 // authorization is handled. 20 ErrUnauthorized = errorsmod.Register(RootCodespace, 4, "unauthorized") 21 22 // ErrInsufficientFunds is used when the account cannot pay requested amount. 23 ErrInsufficientFunds = errorsmod.Register(RootCodespace, 5, "insufficient funds") 24 25 // ErrUnknownRequest to doc 26 ErrUnknownRequest = errorsmod.Register(RootCodespace, 6, "unknown request") 27 28 // ErrInvalidAddress to doc 29 ErrInvalidAddress = errorsmod.Register(RootCodespace, 7, "invalid address") 30 31 // ErrInvalidPubKey to doc 32 ErrInvalidPubKey = errorsmod.Register(RootCodespace, 8, "invalid pubkey") 33 34 // ErrUnknownAddress to doc 35 ErrUnknownAddress = errorsmod.Register(RootCodespace, 9, "unknown address") 36 37 // ErrInvalidCoins to doc 38 ErrInvalidCoins = errorsmod.Register(RootCodespace, 10, "invalid coins") 39 40 // ErrOutOfGas to doc 41 ErrOutOfGas = errorsmod.Register(RootCodespace, 11, "out of gas") 42 43 // ErrMemoTooLarge to doc 44 ErrMemoTooLarge = errorsmod.Register(RootCodespace, 12, "memo too large") 45 46 // ErrInsufficientFee to doc 47 ErrInsufficientFee = errorsmod.Register(RootCodespace, 13, "insufficient fee") 48 49 // ErrTooManySignatures to doc 50 ErrTooManySignatures = errorsmod.Register(RootCodespace, 14, "maximum number of signatures exceeded") 51 52 // ErrNoSignatures to doc 53 ErrNoSignatures = errorsmod.Register(RootCodespace, 15, "no signatures supplied") 54 55 // ErrJSONMarshal defines an ABCI typed JSON marshaling error 56 ErrJSONMarshal = errorsmod.Register(RootCodespace, 16, "failed to marshal JSON bytes") 57 58 // ErrJSONUnmarshal defines an ABCI typed JSON unmarshalling error 59 ErrJSONUnmarshal = errorsmod.Register(RootCodespace, 17, "failed to unmarshal JSON bytes") 60 61 // ErrInvalidRequest defines an ABCI typed error where the request contains 62 // invalid data. 63 ErrInvalidRequest = errorsmod.Register(RootCodespace, 18, "invalid request") 64 65 // ErrTxInMempoolCache defines an ABCI typed error where a tx already exists 66 // in the mempool. 67 ErrTxInMempoolCache = errorsmod.Register(RootCodespace, 19, "tx already in mempool") 68 69 // ErrMempoolIsFull defines an ABCI typed error where the mempool is full. 70 ErrMempoolIsFull = errorsmod.Register(RootCodespace, 20, "mempool is full") 71 72 // ErrTxTooLarge defines an ABCI typed error where tx is too large. 73 ErrTxTooLarge = errorsmod.Register(RootCodespace, 21, "tx too large") 74 75 // ErrKeyNotFound defines an error when the key doesn't exist 76 ErrKeyNotFound = errorsmod.Register(RootCodespace, 22, "key not found") 77 78 // ErrWrongPassword defines an error when the key password is invalid. 79 ErrWrongPassword = errorsmod.Register(RootCodespace, 23, "invalid account password") 80 81 // ErrorInvalidSigner defines an error when the tx intended signer does not match the given signer. 82 ErrorInvalidSigner = errorsmod.Register(RootCodespace, 24, "tx intended signer does not match the given signer") 83 84 // ErrorInvalidGasAdjustment defines an error for an invalid gas adjustment 85 ErrorInvalidGasAdjustment = errorsmod.Register(RootCodespace, 25, "invalid gas adjustment") 86 87 // ErrInvalidHeight defines an error for an invalid height 88 ErrInvalidHeight = errorsmod.Register(RootCodespace, 26, "invalid height") 89 90 // ErrInvalidVersion defines a general error for an invalid version 91 ErrInvalidVersion = errorsmod.Register(RootCodespace, 27, "invalid version") 92 93 // ErrInvalidChainID defines an error when the chain-id is invalid. 94 ErrInvalidChainID = errorsmod.Register(RootCodespace, 28, "invalid chain-id") 95 96 // ErrInvalidType defines an error an invalid type. 97 ErrInvalidType = errorsmod.Register(RootCodespace, 29, "invalid type") 98 99 // ErrTxTimeoutHeight defines an error for when a tx is rejected out due to an 100 // explicitly set timeout height. 101 ErrTxTimeoutHeight = errorsmod.Register(RootCodespace, 30, "tx timeout height") 102 103 // ErrUnknownExtensionOptions defines an error for unknown extension options. 104 ErrUnknownExtensionOptions = errorsmod.Register(RootCodespace, 31, "unknown extension options") 105 106 // ErrWrongSequence defines an error where the account sequence defined in 107 // the signer info doesn't match the account's actual sequence number. 108 ErrWrongSequence = errorsmod.Register(RootCodespace, 32, "incorrect account sequence") 109 110 // ErrPackAny defines an error when packing a protobuf message to Any fails. 111 ErrPackAny = errorsmod.Register(RootCodespace, 33, "failed packing protobuf message to Any") 112 113 // ErrUnpackAny defines an error when unpacking a protobuf message from Any fails. 114 ErrUnpackAny = errorsmod.Register(RootCodespace, 34, "failed unpacking protobuf message from Any") 115 116 // ErrLogic defines an internal logic error, e.g. an invariant or assertion 117 // that is violated. It is a programmer error, not a user-facing error. 118 ErrLogic = errorsmod.Register(RootCodespace, 35, "internal logic error") 119 120 // ErrConflict defines a conflict error, e.g. when two goroutines try to access 121 // the same resource and one of them fails. 122 ErrConflict = errorsmod.Register(RootCodespace, 36, "conflict") 123 124 // ErrNotSupported is returned when we call a branch of a code which is currently not 125 // supported. 126 ErrNotSupported = errorsmod.Register(RootCodespace, 37, "feature not supported") 127 128 // ErrNotFound defines an error when requested entity doesn't exist in the state. 129 ErrNotFound = errorsmod.Register(RootCodespace, 38, "not found") 130 131 // ErrIO should be used to wrap internal errors caused by external operation. 132 // Examples: not DB domain error, file writing etc... 133 ErrIO = errorsmod.Register(RootCodespace, 39, "Internal IO error") 134 135 // ErrAppConfig defines an error occurred if application configuration is 136 // misconfigured. 137 ErrAppConfig = errorsmod.Register(RootCodespace, 40, "error in app.toml") 138 139 // ErrInvalidGasLimit defines an error when an invalid GasWanted value is 140 // supplied. 141 ErrInvalidGasLimit = errorsmod.Register(RootCodespace, 41, "invalid gas limit") 142 143 // ErrPanic should only be set when we recovering from a panic 144 ErrPanic = errorsmod.ErrPanic 145 )