1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Debug, Error)]
6pub enum Error {
7 #[error("io: {0}")]
8 Io(#[from] std::io::Error),
9 #[error("ber encode: {0}")]
10 BerEncode(String),
11 #[error("ber decode: {0}")]
12 BerDecode(String),
13 #[error("invalid object identifier: {0}")]
14 InvalidOid(String),
15 #[error("invalid visible string: {0}")]
16 InvalidVisibleString(String),
17 #[error("marc parse: {0}")]
18 Marc(String),
19 #[error("protocol: {0}")]
20 Protocol(String),
21 #[error("received frame exceeds maximum size ({max} bytes)")]
22 FrameTooLarge { max: usize },
23}
24
25