pub enum TokenError {
Show 23 variants
InsufficientBalance {
required: u128,
available: u128,
},
InsufficientStake {
required: u128,
available: u128,
},
StakeLocked {
unlock_time: i64,
},
InvalidAmount(String),
ProposalNotFound {
proposal_id: String,
},
VotingClosed {
proposal_id: String,
},
AlreadyVoted {
proposal_id: String,
},
QuorumNotMet {
proposal_id: String,
},
Unauthorized {
reason: String,
},
TreasuryError {
message: String,
},
StorageError(String),
InvalidConfig(String),
ArithmeticOverflow {
operation: String,
},
InvalidAddress,
AssetNotFound {
asset_id: String,
},
StakeNotFound {
address: String,
},
MinimumStakeNotMet {
required: u128,
provided: u128,
},
InvalidProposalType,
ProposalAlreadyExecuted {
proposal_id: String,
},
ProposalExecutionFailed {
proposal_id: String,
reason: String,
},
InvalidVotingPower,
InvalidParameter(String),
NotFound(String),
}Expand description
Errors that can occur in token operations
Variants§
InsufficientBalance
Insufficient balance for the operation
InsufficientStake
Insufficient stake for the operation
StakeLocked
Stake is locked and cannot be withdrawn
InvalidAmount(String)
Invalid amount (e.g., zero or negative)
ProposalNotFound
Proposal not found
VotingClosed
Voting period has closed
AlreadyVoted
User has already voted on this proposal
QuorumNotMet
Quorum not met for proposal
Unauthorized operation
Fields
TreasuryError
Treasury operation error
StorageError(String)
Storage operation error
InvalidConfig(String)
Invalid configuration
ArithmeticOverflow
Arithmetic overflow
InvalidAddress
Invalid address
AssetNotFound
Asset not found
StakeNotFound
Stake not found
MinimumStakeNotMet
Minimum stake not met
InvalidProposalType
Invalid proposal type
ProposalAlreadyExecuted
Proposal already executed
ProposalExecutionFailed
Proposal executor returned an error during apply
InvalidVotingPower
Invalid voting power
InvalidParameter(String)
Generic invalid-parameter error (used by bond/insurance flows).
NotFound(String)
Generic not-found error (used by bond/insurance flows).
Trait Implementations§
Source§impl Debug for TokenError
impl Debug for TokenError
Source§impl Display for TokenError
impl Display for TokenError
Source§impl Error for TokenError
impl Error for TokenError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<StorageError> for TokenError
impl From<StorageError> for TokenError
Source§fn from(err: StorageError) -> Self
fn from(err: StorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TokenError
impl RefUnwindSafe for TokenError
impl Send for TokenError
impl Sync for TokenError
impl Unpin for TokenError
impl UnsafeUnpin for TokenError
impl UnwindSafe for TokenError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more