use thiserror::Error;

pub type Result<T> = std::result::Result<T, DdgsError>;

#[derive(Debug, Error)]
pub enum DdgsError {
    #[error("request failed: {0}")]
    Request(#[from] reqwest::Error),

    #[error("invalid url: {0}")]
    Url(#[from] url::ParseError),

    #[error("invalid argument: {0}")]
    InvalidArgument(String),

    #[error("response parse failed: {0}")]
    Parse(String),

    #[error("remote service blocked automated access: {0}")]
    Blocked(String),
}
