mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 09:38:24 -05:00
23 lines
539 B
Rust
23 lines
539 B
Rust
use thiserror::Error;
|
|
use tokio::sync::{mpsc, oneshot};
|
|
|
|
/// Network Errors
|
|
#[allow(missing_docs)]
|
|
#[derive(Error, Debug, Clone, PartialEq, Eq)]
|
|
pub enum NetworkError {
|
|
#[error("sender has been dropped")]
|
|
ChannelClosed,
|
|
}
|
|
|
|
impl<T> From<mpsc::error::SendError<T>> for NetworkError {
|
|
fn from(_: mpsc::error::SendError<T>) -> Self {
|
|
NetworkError::ChannelClosed
|
|
}
|
|
}
|
|
|
|
impl From<oneshot::error::RecvError> for NetworkError {
|
|
fn from(_: oneshot::error::RecvError) -> Self {
|
|
NetworkError::ChannelClosed
|
|
}
|
|
}
|