nifty_asset/generated/errors/
asset.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum AssetError {
13 #[error("Asset already initialized")]
15 AlreadyInitialized = 0x0,
16 #[error("Invalid account length")]
18 InvalidAccountLength = 0x1,
19 #[error("Incomplete extension data")]
21 IncompleteExtensionData = 0x2,
22 #[error("Uninitialized account")]
24 Uninitialized = 0x3,
25 #[error("Extension not found")]
27 ExtensionNotFound = 0x4,
28 #[error("Invalid alignment")]
30 InvalidAlignment = 0x5,
31 #[error("Invalid owner or burn delegate")]
33 InvalidBurnAuthority = 0x6,
34 #[error("Invalid owner or transfer delegate")]
36 InvalidTransferAuthority = 0x7,
37 #[error("Delegate not found")]
39 DelegateNotFound = 0x8,
40 #[error("Delegate role not active")]
42 DelegateRoleNotActive = 0x9,
43 #[error("Invalid delegate")]
45 InvalidDelegate = 0xA,
46 #[error("Invalid asset owner")]
48 InvalidAssetOwner = 0xB,
49 #[error("Asset is locked")]
51 LockedAsset = 0xC,
52 #[error("Invalid authority")]
54 InvalidAuthority = 0xD,
55 #[error("Immutable asset")]
57 ImmutableAsset = 0xE,
58 #[error("Soulbound assets are non-transferable")]
60 CannotTransferSoulbound = 0xF,
61 #[error("Extension data invalid")]
63 ExtensionDataInvalid = 0x10,
64 #[error("Invalid group")]
66 InvalidGroup = 0x11,
67 #[error("Assertion Failure")]
69 AssertionFailure = 0x12,
70 #[error("Group is not empty")]
72 GroupNotEmpty = 0x13,
73 #[error("Asset is already in a group")]
75 AlreadyInGroup = 0x14,
76 #[error("Extension length invalid")]
78 ExtensionLengthInvalid = 0x15,
79}
80
81impl solana_program::program_error::PrintProgramError for AssetError {
82 fn print<E>(&self) {
83 solana_program::msg!(&self.to_string());
84 }
85}