123456789101112131415161718192021222324252627282930 |
- use crate::{amount, asset::AssetId, storage, transaction, AccountId};
- use serde::Serialize;
- /// The errors that can happen in the Verax crate
- #[derive(thiserror::Error, Debug, Serialize)]
- pub enum Error {
- /// A transaction error
- #[error("Transaction: {0}")]
- Transaction(#[from] transaction::Error),
- /// A storage error
- #[error("Storage: {0}")]
- Storage(#[from] storage::Error),
- /// The asset is not defined
- #[error("Asset {0} is not defined")]
- AssetIdNotFound(AssetId),
- /// The asset is not found
- #[error("Asset {0} is not defined")]
- AssetNotFound(String),
- /// The account has not enough balance to perform the operation
- #[error("Not enough funds (asset {1}) for account {0}")]
- InsufficientBalance(AccountId, AssetId),
- /// The amount is invalid
- #[error("Invalid amount: {0}")]
- InvalidAmount(#[from] amount::Error),
- }
|