#[repr(u32)]
pub enum ErrorCode {
Show 54 variants InstructionMissing, InstructionFallbackNotFound, InstructionDidNotDeserialize, InstructionDidNotSerialize, IdlInstructionStub, IdlInstructionInvalidProgram, ConstraintMut, ConstraintHasOne, ConstraintSigner, ConstraintRaw, ConstraintOwner, ConstraintRentExempt, ConstraintSeeds, ConstraintExecutable, ConstraintState, ConstraintAssociated, ConstraintAssociatedInit, ConstraintClose, ConstraintAddress, ConstraintZero, ConstraintTokenMint, ConstraintTokenOwner, ConstraintMintMintAuthority, ConstraintMintFreezeAuthority, ConstraintMintDecimals, ConstraintSpace, RequireViolated, RequireEqViolated, RequireKeysEqViolated, RequireNeqViolated, RequireKeysNeqViolated, RequireGtViolated, RequireGteViolated, AccountDiscriminatorAlreadySet, AccountDiscriminatorNotFound, AccountDiscriminatorMismatch, AccountDidNotDeserialize, AccountDidNotSerialize, AccountNotEnoughKeys, AccountNotMutable, AccountOwnedByWrongProgram, InvalidProgramId, InvalidProgramExecutable, AccountNotSigner, AccountNotSystemOwned, AccountNotInitialized, AccountNotProgramData, AccountNotAssociatedTokenAccount, AccountSysvarMismatch, AccountReallocExceedsLimit, AccountDuplicateReallocs, StateInvalidAddress, DeclaredProgramIdMismatch, Deprecated,
}
Expand description

Error codes that can be returned by internal framework code.

  • >= 100 Instruction error codes
  • >= 1000 IDL error codes
  • >= 2000 constraint error codes
  • >= 3000 account error codes
  • = 4000 state error code
  • >= 4100 misc error codes
  • = 5000 deprecated error code

The starting point for user-defined errors is defined by the ERROR_CODE_OFFSET.

Variants

InstructionMissing

100 - 8 byte instruction identifier not provided

InstructionFallbackNotFound

101 - Fallback functions are not supported

InstructionDidNotDeserialize

102 - The program could not deserialize the given instruction

InstructionDidNotSerialize

103 - The program could not serialize the given instruction

IdlInstructionStub

1000 - The program was compiled without idl instructions

IdlInstructionInvalidProgram

1001 - Invalid program given to the IDL instruction

ConstraintMut

2000 - A mut constraint was violated

ConstraintHasOne

2001 - A has one constraint was violated

ConstraintSigner

2002 - A signer constraint was violated

ConstraintRaw

2003 - A raw constraint was violated

ConstraintOwner

2004 - An owner constraint was violated

ConstraintRentExempt

2005 - A rent exemption constraint was violated

ConstraintSeeds

2006 - A seeds constraint was violated

ConstraintExecutable

2007 - An executable constraint was violated

ConstraintState

2008 - A state constraint was violated

ConstraintAssociated

2009 - An associated constraint was violated

ConstraintAssociatedInit

2010 - An associated init constraint was violated

ConstraintClose

2011 - A close constraint was violated

ConstraintAddress

2012 - An address constraint was violated

ConstraintZero

2013 - Expected zero account discriminant

ConstraintTokenMint

2014 - A token mint constraint was violated

ConstraintTokenOwner

2015 - A token owner constraint was violated

ConstraintMintMintAuthority

The mint mint is intentional -> a mint authority for the mint.

2016 - A mint mint authority constraint was violated

ConstraintMintFreezeAuthority

2017 - A mint freeze authority constraint was violated

ConstraintMintDecimals

2018 - A mint decimals constraint was violated

ConstraintSpace

2019 - A space constraint was violated

RequireViolated

2500 - A require expression was violated

RequireEqViolated

2501 - A require_eq expression was violated

RequireKeysEqViolated

2502 - A require_keys_eq expression was violated

RequireNeqViolated

2503 - A require_neq expression was violated

RequireKeysNeqViolated

2504 - A require_keys_neq expression was violated

RequireGtViolated

2505 - A require_gt expression was violated

RequireGteViolated

2506 - A require_gte expression was violated

AccountDiscriminatorAlreadySet

3000 - The account discriminator was already set on this account

AccountDiscriminatorNotFound

3001 - No 8 byte discriminator was found on the account

AccountDiscriminatorMismatch

3002 - 8 byte discriminator did not match what was expected

AccountDidNotDeserialize

3003 - Failed to deserialize the account

AccountDidNotSerialize

3004 - Failed to serialize the account

AccountNotEnoughKeys

3005 - Not enough account keys given to the instruction

AccountNotMutable

3006 - The given account is not mutable

AccountOwnedByWrongProgram

3007 - The given account is owned by a different program than expected

InvalidProgramId

3008 - Program ID was not as expected

InvalidProgramExecutable

3009 - Program account is not executable

AccountNotSigner

3010 - The given account did not sign

AccountNotSystemOwned

3011 - The given account is not owned by the system program

AccountNotInitialized

3012 - The program expected this account to be already initialized

AccountNotProgramData

3013 - The given account is not a program data account

AccountNotAssociatedTokenAccount

3014 - The given account is not the associated token account

AccountSysvarMismatch

3015 - The given public key does not match the required sysvar

AccountReallocExceedsLimit

3016 - The account reallocation exceeds the MAX_PERMITTED_DATA_INCREASE limit

AccountDuplicateReallocs

3017 - The account was duplicated for more than one reallocation

StateInvalidAddress

4000 - The given state account does not have the correct address

DeclaredProgramIdMismatch

4100 - The declared program id does not match actual program id

Deprecated

5000 - The API being used is deprecated and should no longer be used

Implementations

Gets the name of this [#enum_name].

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.