fluvio_socket/error.rs
1use std::io::Error as IoError;
2
3#[derive(thiserror::Error, Debug)]
4pub enum SocketError {
5 #[error("Socket io {msg}")]
6 Io { source: IoError, msg: String },
7 #[error("Socket closed")]
8 SocketClosed,
9 #[error("Socket is stale")]
10 SocketStale,
11}
12
13impl From<IoError> for SocketError {
14 fn from(err: IoError) -> Self {
15 let msg = err.to_string();
16 SocketError::Io { source: err, msg }
17 }
18}