pub enum XenithError {
Transport {
chain: ChainId,
message: String,
},
Divergence {
key: StateKey,
chains: Vec<ChainId>,
},
Timeout {
id: MessageId,
elapsed_secs: u64,
},
InsufficientFee {
required: String,
provided: String,
},
UnsupportedChain(ChainId),
StoreError(String),
Serialization(String),
}Expand description
Unified error type for all xenith operations.
§Example
use xenith_core::{XenithError, ChainId};
let e = XenithError::UnsupportedChain(ChainId::from(9999));
assert_eq!(e.to_string(), "chain 9999 is not supported by this transport");Variants§
Transport
The chain field identifies which chain the transport was interacting
with when the error occurred. Use ChainId(0) only when the chain
cannot be determined (e.g., during initial connection before chain
ID is known, or when parsing a response that carries no chain context).
Divergence
Timeout
InsufficientFee
UnsupportedChain(ChainId)
StoreError(String)
Serialization(String)
Trait Implementations§
Source§impl Clone for XenithError
impl Clone for XenithError
Source§fn clone(&self) -> XenithError
fn clone(&self) -> XenithError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for XenithError
impl Debug for XenithError
Source§impl Display for XenithError
impl Display for XenithError
Source§impl Error for XenithError
impl Error for XenithError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for XenithError
impl RefUnwindSafe for XenithError
impl Send for XenithError
impl Sync for XenithError
impl Unpin for XenithError
impl UnsafeUnpin for XenithError
impl UnwindSafe for XenithError
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
Mutably borrows from an owned value. Read more