1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum Error {
5 #[error("Topic not found: {0}")]
6 TopicNotFound(String),
7
8 #[error("Partition not found: {0}")]
9 PartitionNotFound(u32),
10
11 #[error("Invalid offset: {0}")]
12 InvalidOffset(u64),
13
14 #[error("Serialization error: {0}")]
15 SerializationError(#[from] postcard::Error),
16
17 #[error("I/O error: {0}")]
18 IoError(#[from] std::io::Error),
19
20 #[error("Invalid configuration: {0}")]
21 InvalidConfig(String),
22
23 #[error("{0}")]
24 Other(String),
25}
26
27pub type Result<T> = std::result::Result<T, Error>;