1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::io;
use std::num::ParseIntError;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Invalid command or arguments")]
CommandError { msg: String },
#[error("The server closed the connection")]
Disconnected,
#[error(transparent)]
IOError(#[from] io::Error),
#[error("Server error")]
ServerError { msg: String },
#[error("invalid value error")]
ValueError { msg: String },
#[error(transparent)]
ParseInteError(#[from] ParseIntError),
}