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.
hydrus-utils/src/error.rs

34 lines
723 B
Rust

use hydrus_api::error::Error as HydrusError;
use pixiv_rs::error::Error as PixivError;
use rustnao::Error as RustNaoError;
use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
Pixiv(#[from] PixivError),
#[error("{0}")]
RustNao(String),
#[error(transparent)]
Hydrus(#[from] HydrusError),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Reqwest(#[from] reqwest::Error),
#[error("Error in config {0}")]
Config(#[from] config::ConfigError),
}
impl From<RustNaoError> for Error {
fn from(e: RustNaoError) -> Self {
Self::RustNao(e.to_string())
}
}