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.

19 lines
351 B
Rust

use thiserror::Error;
pub type XKCDResult<T> = Result<T, XKCDError>;
#[derive(Debug, Error)]
pub enum XKCDError {
#[error(transparent)]
Reqwest(#[from] reqwest::Error),
#[error("Parse Error: {0}")]
ParseError(String),
}
impl From<&str> for XKCDError {
fn from(s: &str) -> Self {
Self::ParseError(s.to_string())
}
}