12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #[derive(Debug)]
- pub enum Error {
-
-
- WireError(dns::WireError),
-
- NetworkError(std::io::Error),
-
-
- TruncatedResponse,
-
- #[cfg(feature = "with_nativetls")]
- TlsError(native_tls::Error),
-
- #[cfg(feature = "with_nativetls")]
- TlsHandshakeError(native_tls::HandshakeError<std::net::TcpStream>),
-
- #[cfg(feature = "with_rustls")]
- RustlsInvalidDnsNameError(webpki::InvalidDNSNameError),
-
- #[cfg(feature = "with_https")]
- HttpError(httparse::Error),
-
-
- #[cfg(feature = "with_https")]
- WrongHttpStatus(u16, Option<String>),
- }
- impl From<dns::WireError> for Error {
- fn from(inner: dns::WireError) -> Self {
- Self::WireError(inner)
- }
- }
- impl From<std::io::Error> for Error {
- fn from(inner: std::io::Error) -> Self {
- Self::NetworkError(inner)
- }
- }
- #[cfg(feature = "with_nativetls")]
- impl From<native_tls::Error> for Error {
- fn from(inner: native_tls::Error) -> Self {
- Self::TlsError(inner)
- }
- }
- #[cfg(feature = "with_nativetls")]
- impl From<native_tls::HandshakeError<std::net::TcpStream>> for Error {
- fn from(inner: native_tls::HandshakeError<std::net::TcpStream>) -> Self {
- Self::TlsHandshakeError(inner)
- }
- }
- #[cfg(feature = "with_rustls")]
- impl From<webpki::InvalidDNSNameError> for Error {
- fn from(inner: webpki::InvalidDNSNameError) -> Self {
- Self::RustlsInvalidDnsNameError(inner)
- }
- }
- #[cfg(feature = "with_https")]
- impl From<httparse::Error> for Error {
- fn from(inner: httparse::Error) -> Self {
- Self::HttpError(inner)
- }
- }
|