rpc_toy/error.rs
1#[derive(Debug, thiserror::Error)]
2/// An error representing all the errors that could happen
3pub enum Error {
4 #[error("Error Working with a TCP stream: {0}")]
5 StreamError(#[from] std::io::Error),
6 #[error("Error working with JSON: {0}")]
7 JSONError(#[from] serde_json::Error),
8 #[error("Invalid utf8 error: {0}")]
9 UTF8Error(#[from] std::str::Utf8Error),
10}