tokio_mc/error.rs
1use thiserror::Error;
2
3use crate::frame::{KVError, ProtocolError};
4
5#[derive(Debug, Error)]
6pub enum Error {
7 #[error("Protocol error occurred: {0:?}")]
8 Protocol(#[from] ProtocolError), // 将 ProtocolError 包装为 Protocol 错误
9
10 #[error(transparent)]
11 Transport(#[from] std::io::Error),
12
13 #[error("Keyence-specific error: {0}")]
14 KV(#[from] KVError),
15
16 #[error("Utf8 error: {0}")]
17 Utf8Error(String),
18}