better_url/errors/
port.rs1use thiserror::Error;
4
5use crate::prelude::*;
6
7#[derive(Debug, Error)]
9#[error("Attempted to parse an invalid port.")]
10pub struct InvalidPort;
11
12#[derive(Debug, Error)]
14pub enum SetPortError {
15 #[error(transparent)]
17 NoHost(#[from] NoHost),
18 #[error("Attempted to set the port of an empty host.")]
20 EmptyHost,
21 #[error("Attempted to set the port of a file URL.")]
23 SchemeIsFile,
24 #[error(transparent)]
26 InvalidPort(#[from] InvalidPort),
27 #[error("Attempted to set a URL that can't have a port to have a port")]
29 CantHavePort,
30 #[error(transparent)]
32 TooLong(#[from] TooLong),
33}