1use cosmwasm_std::{Coin, StdError};
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum ContractError {
6 #[error("{0}")]
7 Std(#[from] StdError),
8
9 #[error("Unauthorized")]
11 Unauthorized,
12
13 #[error("Cannot set approval that is already expired")]
15 Expired,
16
17 #[error("{operator} has already been approved")]
19 OperatorApproved { operator: String },
20
21 #[error("Approval not found for: {operator}")]
23 ApprovalNotFound { operator: String },
24
25 #[error("token_id: {token_id} does not exist")]
27 InvalidToken { token_id: u64 },
28
29 #[error("Invalid amount. Expected {val:?} received {funds:?}")]
31 InvalidAmount { val: Coin, funds: Coin },
32
33 #[error("Following error occured: {val:?}")]
35 CustomError { val: String },
36 }