You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bromine/src/error.rs

34 lines
634 B
Rust

use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
IoError(#[from] tokio::io::Error),
#[error(transparent)]
Decode(#[from] rmp_serde::decode::Error),
#[error(transparent)]
Encode(#[from] rmp_serde::encode::Error),
#[error("Build Error: {0}")]
BuildError(String),
#[error("{0}")]
Message(String),
}
impl From<String> for Error {
fn from(s: String) -> Self {
Error::Message(s)
}
}
impl From<&str> for Error {
fn from(s: &str) -> Self {
Error::Message(s.to_string())
}
}