use alloc::boxed::Box;
use core::error::Error as StdError;
use thiserror::Error;
pub type Result<T = (), E = Error> = core::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum Error {
#[error("missing URL scheme")]
MissingUrlScheme,
#[error("missing URL host")]
MissingUrlHost,
#[cfg(feature = "std")]
#[error("TCP connection failed: {0}")]
TcpConnectFailed(std::io::Error),
#[error("HTTP handshake failed: {0}")]
HttpHandshakeFailed(hyper::Error),
#[error("HTTP request failed: {0}")]
HttpRequestFailed(#[from] hyper::Error),
#[cfg(feature = "std")]
#[error("I/O failed: {0}")]
StdioFailed(#[from] std::io::Error),
#[error("unknown error: {0}")]
Other(#[from] Box<dyn StdError + Send + Sync>),
}