use thiserror::Error;
use crate::prelude::*;
#[derive(Debug, Error)]
pub enum InvalidUrl {
#[error(transparent)] InvalidScheme (#[from] InvalidScheme ),
#[error(transparent)] InvalidFileHost (#[from] InvalidFileHost ),
#[error(transparent)] InvalidSpecialNotFileHost(#[from] InvalidSpecialNotFileHost),
#[error(transparent)] InvalidNonSpecialHost (#[from] InvalidNonSpecialHost ),
#[error(transparent)] InvalidPort (#[from] InvalidPort ),
#[error(transparent)] TooLong (#[from] TooLong ),
#[error("Attempted to parse a URL with no scheme.")]
MissingScheme,
#[error("Attempted to parse a URL with an empty host and a userinfo and/or port.")]
EmptyHostCantHaveUserinfoOrPort,
}
#[derive(Debug, Error)]
pub enum InvalidJoin {
#[error(transparent)] TooLong (#[from] TooLong ),
#[error(transparent)] InvalidUrl (#[from] InvalidUrl ),
#[error(transparent)] InvalidScheme (#[from] InvalidScheme ),
#[error(transparent)] CannotBeABase (#[from] CannotBeABase ),
#[error("Attempted to join a non-relative URL with something other than a fragment or a whole URL.")]
MissingSchemeNonRelativeUrl,
}
#[derive(Debug, Error)]
#[error("Attempted to join more than the fragment on a cannot-be-a-base URL.")]
pub struct CannotBeABase;