1use std::{io, string};
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum TelnetError {
7 #[error("`{0}` Operation timeout.")]
8 Timeout(String),
9 #[error("io error.")]
10 IOError(#[from] io::Error),
11 #[error("Parse string error.")]
12 ParseError(#[from] string::FromUtf8Error),
13 #[error("Unknown IAC command `{0}`.")]
14 UnknownIAC(String),
15 #[error("Authentication failed.")]
16 AuthenticationFailed,
17 #[error("No more data.")]
18 NoMoreData,
19 #[error("Init Color regex failed `{0}`.")]
20 RegexError(#[from] regex::Error),
21}