Skip to main content

multiliquid_svm_sdk/
error.rs

1use crate::Pubkey;
2
3/// Errors from transport, decoding, validation, and local quote calculations.
4#[derive(Debug, thiserror::Error)]
5pub enum SdkError {
6    #[error("invalid input: {0}")]
7    InvalidInput(String),
8    #[error("invalid account: {0}")]
9    InvalidAccount(String),
10    #[error("account not found: {0}")]
11    AccountNotFound(Pubkey),
12    #[error("arithmetic overflow")]
13    MathOverflow,
14    #[error("oracle error: {0}")]
15    Oracle(String),
16    #[error("RPC error: {0}")]
17    Rpc(String),
18    #[error("simulation error: {0}")]
19    Simulation(String),
20    #[error(transparent)]
21    Program(#[from] crate::errors::ParsedSimulationProgramError),
22    #[error(transparent)]
23    Io(#[from] std::io::Error),
24}
25
26pub type Result<T, E = SdkError> = std::result::Result<T, E>;