Skip to main content

scemadex_sdk/
error.rs

1use thiserror::Error;
2
3/// Errors surfaced across the ScemaDEX SDK.
4#[derive(Debug, Error)]
5pub enum ScemaDexError {
6    #[error("no route found for intent: {0}")]
7    NoRoute(String),
8    #[error("intent violated constraint: {0}")]
9    ConstraintViolation(String),
10    #[error("bond settlement failed: {0}")]
11    Bond(String),
12    #[error("venue execution failed: {0}")]
13    Venue(String),
14    #[error("signal oracle error: {0}")]
15    Oracle(String),
16    #[error("peer market error: {0}")]
17    Mesh(String),
18    #[error("invalid address: {0}")]
19    InvalidAddress(String),
20    #[error("{0}")]
21    Other(String),
22}
23
24pub type Result<T> = std::result::Result<T, ScemaDexError>;