diff options
Diffstat (limited to 'net/src')
-rw-r--r-- | net/src/error.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/net/src/error.rs b/net/src/error.rs index a1c85db..346184a 100644 --- a/net/src/error.rs +++ b/net/src/error.rs @@ -4,7 +4,7 @@ pub type Result<T> = std::result::Result<T, Error>; #[derive(ThisError, Debug)] pub enum Error { - #[error("IO Error: {0}")] + #[error(transparent)] IO(#[from] std::io::Error), #[error("Try from endpoint Error")] @@ -25,10 +25,10 @@ pub enum Error { #[error("Channel Send Error: {0}")] ChannelSend(String), - #[error("Channel Receive Error: {0}")] - ChannelRecv(String), + #[error(transparent)] + ChannelRecv(#[from] smol::channel::RecvError), - #[error("Karyons core error : {0}")] + #[error(transparent)] KaryonsCore(#[from] karyons_core::error::Error), } @@ -37,9 +37,3 @@ impl<T> From<smol::channel::SendError<T>> for Error { Error::ChannelSend(error.to_string()) } } - -impl From<smol::channel::RecvError> for Error { - fn from(error: smol::channel::RecvError) -> Self { - Error::ChannelRecv(error.to_string()) - } -} |