pub(super) enum ChannelError {
Ignore(String),
Warn(String),
- Close(String),
+ Close((String, ClosureReason)),
}
impl fmt::Debug for ChannelError {
match self {
&ChannelError::Ignore(ref e) => write!(f, "Ignore : {}", e),
&ChannelError::Warn(ref e) => write!(f, "Warn : {}", e),
- &ChannelError::Close(ref e) => write!(f, "Close : {}", e),
+ &ChannelError::Close((ref e, _)) => write!(f, "Close : {}", e),
}
}
}
match self {
&ChannelError::Ignore(ref e) => write!(f, "{}", e),
&ChannelError::Warn(ref e) => write!(f, "{}", e),
- &ChannelError::Close(ref e) => write!(f, "{}", e),
+ &ChannelError::Close((ref e, _)) => write!(f, "{}", e),
}
}
}
impl ChannelError {
pub(super) fn close(err: String) -> Self {
- ChannelError::Close(err.clone())
+ ChannelError::Close((err.clone(), ClosureReason::ProcessingError { err }))
}
}