1use thiserror::Error;
9use twine_codec::TwineCodecError;
10
11#[derive(Debug, Error)]
12pub enum TwineCtlError {
13 #[error("Command error: {0}")]
14 CommandError(String),
15
16 #[error(transparent)]
17 IoError(#[from] std::io::Error),
18
19 #[error(transparent)]
20 SerialPortError(#[from] serialport::Error),
21
22 #[error("Serial port read error")]
23 SerialPortReadError,
24
25 #[error("Not enough data returned from a shell command to parse response")]
26 ShellParseError,
27
28 #[error("Timeout waiting for response")]
29 TimeoutError,
30
31 #[error(transparent)]
32 CodecError(#[from] TwineCodecError),
33
34 #[error("Unexpected end of file")]
35 UnexpectedEof,
36}