pub enum ScopeError {
Show 20 variants
Config(ConfigError),
Chain(String),
Venue {
venue: String,
message: String,
},
Request(Error),
InvalidAddress(String),
InvalidHash(String),
IoError(Error),
Export(String),
Json(Error),
Network(String),
Api(String),
NotFound(String),
TokenNotFound {
input: String,
searched: String,
},
AmbiguousToken {
input: String,
candidates: Vec<String>,
},
TokenMismatch {
symbol: String,
chain: String,
saved: String,
venue_contract: String,
venue: String,
},
InvalidInput(String),
Compliance(String),
Discovery(String),
Contract(String),
Other(String),
}Expand description
The primary error type for the Scope application.
This enum encompasses all error conditions that can occur during blockchain analysis operations. Each variant provides context-specific information to aid in debugging and user-friendly error messages.
Variants§
Config(ConfigError)
Configuration file could not be loaded or parsed.
This includes missing files, invalid YAML syntax, or schema violations.
Chain(String)
Blockchain client encountered an error.
This covers RPC failures, unsupported chain operations, or protocol errors.
Venue
A market venue (exchange) request or capability failed.
venue is the venue id that made the request, for example bybit.
Request(Error)
HTTP request to an external API failed.
Wraps reqwest errors for network failures, timeouts, or HTTP error responses.
InvalidAddress(String)
The provided blockchain address is malformed.
Addresses must be valid for their respective chain (e.g., 0x-prefixed 40-character hex string for Ethereum).
InvalidHash(String)
The provided transaction hash is malformed.
Transaction hashes must be valid for their respective chain.
IoError(Error)
An I/O operation failed. Context goes into the error’s message
(io::Error::new(e.kind(), …)); the kind stays, so callers can
tell a closed pipe from a full disk.
Export(String)
Data export operation failed.
Json(Error)
JSON serialization/deserialization error.
Network(String)
Network operation failed.
Api(String)
External API returned an error.
NotFound(String)
Resource not found.
TokenNotFound
No token matches a symbol in the place that was searched.
Fields
AmbiguousToken
A symbol names more than one token and scope cannot ask which one.
Fields
TokenMismatch
A saved binding names a different contract than the venue lists.
Fields
InvalidInput(String)
The request itself is at fault and the caller can fix it: an unknown venue, or a chain that a DEX venue does not read. The message is shown as is.
Compliance(String)
Compliance or risk analysis failed.
Discovery(String)
Token discovery operation failed.
Contract(String)
Contract analysis failed.
Other(String)
Other unspecified error.
Implementations§
Source§impl ScopeError
impl ScopeError
Sourcepub fn io_context(e: Error, context: impl Display) -> Self
pub fn io_context(e: Error, context: impl Display) -> Self
The one way to wrap an I/O error with what was being done: the
message reads <context>: <error> and the error kind stays, so a
closed pipe is still a closed pipe.
Trait Implementations§
Source§impl Debug for ScopeError
impl Debug for ScopeError
Source§impl Display for ScopeError
impl Display for ScopeError
Source§impl Error for ScopeError
impl Error for ScopeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ConfigError> for ScopeError
impl From<ConfigError> for ScopeError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Source§impl From<Error> for ScopeError
impl From<Error> for ScopeError
Source§impl From<Error> for ScopeError
impl From<Error> for ScopeError
Auto Trait Implementations§
impl !RefUnwindSafe for ScopeError
impl !UnwindSafe for ScopeError
impl Freeze for ScopeError
impl Send for ScopeError
impl Sync for ScopeError
impl Unpin for ScopeError
impl UnsafeUnpin for ScopeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.