use thiserror::Error;
use crate::prelude::*;
#[derive(Debug, Error)]
#[error("Attempted to parse an invalid port.")]
pub struct InvalidPort;
#[derive(Debug, Error)]
pub enum SetPortError {
#[error(transparent)]
NoHost(#[from] NoHost),
#[error("Attempted to set the port of an empty host.")]
EmptyHost,
#[error("Attempted to set the port of a file URL.")]
SchemeIsFile,
#[error(transparent)]
InvalidPort(#[from] InvalidPort),
#[error("Attempted to set a URL that can't have a port to have a port")]
CantHavePort,
#[error(transparent)]
TooLong(#[from] TooLong),
}