pub mod dns;
pub mod http;
pub mod parse;
pub mod socket;
pub use dns::DnsError;
pub use parse::ParseError;
pub use socket::SocketError;
#[derive(Debug)]
pub enum Error {
Parse(ParseError),
Dns(DnsError),
Socket(SocketError),
InvalidUrl,
NoAddresses,
IpAddressNotSupported,
TooManyRedirects,
MissingRedirectLocation,
InvalidRedirectLocation,
RedirectLoop,
HttpStatus(u16),
HttpsRequired,
ResponseHeaderTooLarge,
Utf8Error,
}
impl From<ParseError> for Error {
fn from(e: ParseError) -> Self {
Self::Parse(e)
}
}
impl From<DnsError> for Error {
fn from(e: DnsError) -> Self {
Self::Dns(e)
}
}
impl From<SocketError> for Error {
fn from(e: SocketError) -> Self {
Self::Socket(e)
}
}
impl From<alloc::string::FromUtf8Error> for Error {
fn from(_: alloc::string::FromUtf8Error) -> Self {
Self::Utf8Error
}
}