#[derive(Debug, thiserror::Error)]
pub enum DecodeError {
#[error("custom: {0}")]
Custom(String),
#[error("invalid type: {0}")]
InvalidType(String),
#[error("not found")]
NotFound,
#[error(transparent)]
Anchor(#[from] anchor_lang::prelude::Error),
}
impl DecodeError {
pub fn custom(msg: impl ToString) -> Self {
Self::Custom(msg.to_string())
}
}