1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, BridgeError>;
6
7#[derive(Error, Debug)]
8pub enum BridgeError {
9 #[error("connection failed: {0}")]
10 ConnectionFailed(String),
11
12 #[error("protocol error: {0}")]
13 Protocol(String),
14
15 #[error("mapping error: {0}")]
16 Mapping(String),
17
18 #[error("send error: {0}")]
19 Send(String),
20
21 #[error("receive error: {0}")]
22 Receive(String),
23
24 #[error("device not found: {0}")]
25 DeviceNotFound(String),
26
27 #[error("io error: {0}")]
28 Io(#[from] std::io::Error),
29
30 #[error("bridge error: {0}")]
31 Other(String),
32}