IronForce is a decentralized network, Degeon is a messenger built on it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
570 B

use alloc::format;
use alloc::string::String;
use core::fmt::Debug;
/// An enum for all errors that may occur
#[derive(Clone, PartialEq, Debug)]
pub enum IFError {
/// An error that was created in some dependency and then converted to `IFError`
General(String),
/// A tunnel satisfying some conditions has not been found
TunnelNotFound,
}
impl<T: Debug + core_error::Error> From<T> for IFError {
/// Convert from other error
fn from(e: T) -> Self {
Self::General(format!("{:?}", e))
}
}
pub type IFResult<T> = Result<T, IFError>;