1use imap_core::error::ParseError;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum ClientError {
6 #[error("I/O error: {0}")]
7 Io(#[from] std::io::Error),
8 #[error("Parse error: {0}")]
9 Parse(#[from] ParseError),
10 #[error("Connection closed")]
11 ConnectionClosed,
12 #[error("response frame exceeded the maximum size of {max} bytes")]
13 FrameTooLarge { max: usize },
14 #[error("Command failed: {0}")]
15 CommandFailed(String),
16 #[error("Capability not supported: {0}")]
17 UnsupportedCapability(&'static str),
18 #[error("Command timed out")]
19 Timeout,
20}