1#[derive(thiserror::Error, Debug)]
2#[non_exhaustive]
3pub enum UnderError {
6 #[error("could not parse the given string ({:?}) as an address", .0)]
7 InvalidAddress(String),
10 #[error("could not serve server")]
11 HyperServer(#[source] hyper::Error),
14 #[error("could not read the body of a request or response")]
17 ReadBody(#[source] std::io::Error),
18 #[cfg(feature = "json")]
19 #[cfg_attr(nightly, doc(cfg(feature = "json")))]
20 #[error("could not deserialize the body of a request or response from JSON")]
23 JsonDeserialization(#[source] serde_json::Error),
24 #[cfg(feature = "cbor")]
25 #[cfg_attr(nightly, doc(cfg(feature = "cbor")))]
26 #[error("could not deserialize the body of a request or response from CBOR")]
29 CborDeserialization(#[source] anyhow::Error),
30 #[cfg(feature = "msgpack")]
31 #[cfg_attr(nightly, doc(cfg(feature = "msgpack")))]
32 #[error("could not deserialize the body of a request or response from MessagePack")]
35 MsgpackDeserialization(#[source] rmp_serde::decode::Error),
36 #[error("could not deserialize the body of a request or response from utf-8")]
39 TextDeserialization(#[source] std::string::FromUtf8Error),
40 #[cfg(feature = "from_form")]
41 #[cfg_attr(nightly, doc(cfg(feature = "from_form")))]
42 #[error("could not deserialize the body of a request or response from urlencoded")]
45 FormDeserialization(#[source] crate::from_form::FromFormError),
46 #[error("the content-type of the request was invalid")]
49 UnsupportedMediaType(Option<mime::Mime>),
50 #[error("the request body of the request was too long, and was cut off")]
53 PayloadTooLarge(#[source] anyhow::Error),
54}