mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
error: add timeout error
This commit is contained in:
18
src/error.rs
18
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<VerifyFailed> for ClientFailed {
|
||||
}
|
||||
}
|
||||
|
||||
// TEMP
|
||||
#[cfg(feature = "net2")]
|
||||
impl<T: std::fmt::Display> From<crate::net2::transport::TransportError<T>> for Error {
|
||||
fn from(err: crate::net2::transport::TransportError<T>) -> Self {
|
||||
@@ -348,6 +352,20 @@ impl<T: std::fmt::Display> From<crate::net2::transport::TransportError<T>> for E
|
||||
}
|
||||
}
|
||||
|
||||
// TEMP
|
||||
#[cfg(feature = "net3")]
|
||||
impl<T: std::fmt::Display> From<crate::net3::transport::TransportError<T>> for Error {
|
||||
fn from(err: crate::net3::transport::TransportError<T>) -> Self {
|
||||
Self::TransportError(err.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<async_std::future::TimeoutError> for Error {
|
||||
fn from(_err: async_std::future::TimeoutError) -> Self {
|
||||
Self::TimeoutError
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for Error {
|
||||
fn from(err: std::io::Error) -> Self {
|
||||
Self::Io(err.kind())
|
||||
|
||||
Reference in New Issue
Block a user