#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum UnderError {
#[error("could not parse the given string ({:?}) as an address", .0)]
InvalidAddress(String),
#[error("could not serve server")]
HyperServer(#[source] hyper::Error),
#[error("could not read the body of a request or response")]
ReadBody(#[source] std::io::Error),
#[cfg(feature = "json")]
#[doc(cfg(feature = "json"))]
#[error("could not deserialize the body of a request or response from JSON")]
JsonDeserialization(#[source] serde_json::Error),
#[cfg(feature = "cbor")]
#[doc(cfg(feature = "cbor"))]
#[error("could not deserialize the body of a request or response from CBOR")]
CborDeserialization(#[source] anyhow::Error),
#[cfg(feature = "msgpack")]
#[doc(cfg(feature = "msgpack"))]
#[error("could not deserialize the body of a request or response from MessagePack")]
MsgpackDeserialization(#[source] rmp_serde::decode::Error),
#[error("could not deserialize the body of a request or response from utf-8")]
TextDeserialization(#[source] std::string::FromUtf8Error),
#[cfg(feature = "from_form")]
#[doc(cfg(feature = "from_form"))]
#[error("could not deserialize the body of a request or response from urlencoded")]
FormDeserialization(#[source] crate::from_form::FromFormError),
#[error("the content-type of the request was invalid")]
UnsupportedMediaType(Option<mime::Mime>),
#[error("the request body of the request was too long, and was cut off")]
PayloadTooLarge(#[source] anyhow::Error),
}