nifty_asset/generated/errors/
asset.rs

1//! This code was AUTOGENERATED using the kinobi library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun kinobi to update it.
4//!
5//! <https://github.com/kinobi-so/kinobi>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum AssetError {
13    /// 0 - Asset already initialized
14    #[error("Asset already initialized")]
15    AlreadyInitialized = 0x0,
16    /// 1 - Invalid account length
17    #[error("Invalid account length")]
18    InvalidAccountLength = 0x1,
19    /// 2 - Incomplete extension data
20    #[error("Incomplete extension data")]
21    IncompleteExtensionData = 0x2,
22    /// 3 - Uninitialized account
23    #[error("Uninitialized account")]
24    Uninitialized = 0x3,
25    /// 4 - Extension not found
26    #[error("Extension not found")]
27    ExtensionNotFound = 0x4,
28    /// 5 - Invalid alignment
29    #[error("Invalid alignment")]
30    InvalidAlignment = 0x5,
31    /// 6 - Invalid owner or burn delegate
32    #[error("Invalid owner or burn delegate")]
33    InvalidBurnAuthority = 0x6,
34    /// 7 - Invalid owner or transfer delegate
35    #[error("Invalid owner or transfer delegate")]
36    InvalidTransferAuthority = 0x7,
37    /// 8 - Delegate not found
38    #[error("Delegate not found")]
39    DelegateNotFound = 0x8,
40    /// 9 - Delegate role not active
41    #[error("Delegate role not active")]
42    DelegateRoleNotActive = 0x9,
43    /// 10 - Invalid delegate
44    #[error("Invalid delegate")]
45    InvalidDelegate = 0xA,
46    /// 11 - Invalid asset owner
47    #[error("Invalid asset owner")]
48    InvalidAssetOwner = 0xB,
49    /// 12 - Asset is locked
50    #[error("Asset is locked")]
51    LockedAsset = 0xC,
52    /// 13 - Invalid authority
53    #[error("Invalid authority")]
54    InvalidAuthority = 0xD,
55    /// 14 - Immutable asset
56    #[error("Immutable asset")]
57    ImmutableAsset = 0xE,
58    /// 15 - Soulbound assets are non-transferable
59    #[error("Soulbound assets are non-transferable")]
60    CannotTransferSoulbound = 0xF,
61    /// 16 - Extension data invalid
62    #[error("Extension data invalid")]
63    ExtensionDataInvalid = 0x10,
64    /// 17 - Invalid group
65    #[error("Invalid group")]
66    InvalidGroup = 0x11,
67    /// 18 - Assertion Failure
68    #[error("Assertion Failure")]
69    AssertionFailure = 0x12,
70    /// 19 - Group is not empty
71    #[error("Group is not empty")]
72    GroupNotEmpty = 0x13,
73    /// 20 - Asset is already in a group
74    #[error("Asset is already in a group")]
75    AlreadyInGroup = 0x14,
76    /// 21 - Extension length invalid
77    #[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}