use alloc::string::String;
#[cfg(any(feature = "request", feature = "request_std"))]
#[derive(Debug)]
pub enum ProductOSRequestError {
Error(String),
InvalidUri(String),
Timeout(String),
Tls(String),
BodyError(String),
#[deprecated(
since = "0.0.54",
note = "Use Result::Ok instead of ProductOSRequestError::None"
)]
None,
}
#[cfg(any(feature = "request", feature = "request_std"))]
impl core::fmt::Display for ProductOSRequestError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
#[allow(deprecated)]
match &self {
ProductOSRequestError::Error(m) => write!(f, "{}", m),
ProductOSRequestError::InvalidUri(m) => write!(f, "Invalid URI: {}", m),
ProductOSRequestError::Timeout(m) => write!(f, "Request timeout: {}", m),
ProductOSRequestError::Tls(m) => write!(f, "TLS error: {}", m),
ProductOSRequestError::BodyError(m) => write!(f, "Body error: {}", m),
ProductOSRequestError::None => write!(f, "No error"),
}
}
}
#[cfg(any(feature = "std_base", feature = "std_reqwest", feature = "std_hyper"))]
impl std::error::Error for ProductOSRequestError {}