The TZIP-12 defines the set of standard errors to make it easier to integrate FA2 contracts with wallets, DApps and other generic software, and enable localization of user-visible error messages.
Each error code is a short-abbreviated string mnemonic. An FA2 contract client could use on-the-chain or off-the-chain registry to map the error code mnemonic to a user-readable, localized message.
A particular implementation of the FA2 contract MAY extend the standard set of errors with custom mnemonics for additional constraints.
Standard error mnemonics:
|One of the specified token_ids is not defined within the FA2 contract|
|A token owner does not have sufficient balance to transfer tokens from owner's account|
|A transfer failed because of operator_transfer_policy == No_transfer|
|A transfer failed because operator_transfer_policy == Owner_transfer and it is invoked not by the token owner|
|A transfer failed because operator_transfer_policy == Owner_or_operator_transfer and it is invoked neither by the token owner nor a permitted operator|
|update_operators entrypoint is invoked and operator_transfer_policy is No_transfer or Owner_transfer|
FA2 lib custom errors mnemonics:
If more than one error conditions are met, the entrypoint MAY fail with any applicable error.