diff --git a/src/error.rs b/src/error.rs index 35a5a64e2..28459af39 100644 --- a/src/error.rs +++ b/src/error.rs @@ -95,6 +95,9 @@ pub enum Error { #[error("Connection failed")] ConnectFailed, + #[error("Timeout Error")] + TimeoutError, + #[error("Connection timed out")] ConnectTimeout, @@ -341,6 +344,7 @@ impl From for ClientFailed { } } +// TEMP #[cfg(feature = "net2")] impl From> for Error { fn from(err: crate::net2::transport::TransportError) -> Self { @@ -348,6 +352,20 @@ impl From> for E } } +// TEMP +#[cfg(feature = "net3")] +impl From> for Error { + fn from(err: crate::net3::transport::TransportError) -> Self { + Self::TransportError(err.to_string()) + } +} + +impl From for Error { + fn from(_err: async_std::future::TimeoutError) -> Self { + Self::TimeoutError + } +} + impl From for Error { fn from(err: std::io::Error) -> Self { Self::Io(err.kind())