use thiserror::Error;
use crate::prelude::*;
#[derive(Debug, Error)]
#[error("Attempted to parse invalid Punycode.")]
pub struct InvalidPunycode;
#[derive(Debug, Error)]
#[error("Attempted to parse an invalid DomainSegment.")]
pub struct InvalidDomainSegment;
#[derive(Debug, Error)]
#[error("Attempted to parse an invalid DomainSegments.")]
pub struct InvalidDomainSegments;
#[derive(Debug, Error)]
#[error("Attempted to parse an invalid DomainHost.")]
pub struct InvalidDomainHost;
impl From<InvalidDomainSegment > for InvalidDomainSegments {fn from(_: InvalidDomainSegment ) -> Self {Self}}
impl From<InvalidDomainSegment > for InvalidDomainHost {fn from(_: InvalidDomainSegment ) -> Self {Self}}
impl From<InvalidDomainSegments> for InvalidDomainHost {fn from(_: InvalidDomainSegments) -> Self {Self}}
#[derive(Debug, Error)]
#[error("Attempted to end a domain in a number.")]
pub struct CantEndInANumber;
#[derive(Debug, Error)]
#[error("Attempted to end a non-FQDN DomainHost in an empty segment.")]
pub struct NonFqdnCantEndInEmpty;
#[derive(Debug, Error)]
pub enum SetDomainError {
#[error(transparent)] InvalidDomainSegments(#[from] InvalidDomainSegments),
#[error(transparent)] TooLong (#[from] TooLong ),
#[error(transparent)] InsertNotFound (#[from] InsertNotFound ),
#[error(transparent)] RangeNotFound (#[from] RangeNotFound ),
#[error(transparent)] CantEndInANumber (#[from] CantEndInANumber ),
#[error(transparent)] NonFqdnCantEndInEmpty(#[from] NonFqdnCantEndInEmpty),
#[error(transparent)] InvalidDomainSegment (#[from] InvalidDomainSegment ),
#[error(transparent)] CantBeEmpty (#[from] CantBeEmpty ),
#[error(transparent)] InvalidDomainHost (#[from] InvalidDomainHost ),
}