Skip to main content

azoth_bus/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum BusError {
5    #[error("Azoth error: {0}")]
6    Azoth(#[from] azoth_core::error::AzothError),
7
8    #[error("Consumer not found: {0}")]
9    ConsumerNotFound(String),
10
11    #[error("Invalid consumer state: {0}")]
12    InvalidState(String),
13
14    #[error("Serialization error: {0}")]
15    Serialization(#[from] serde_json::Error),
16
17    #[error("IO error: {0}")]
18    Io(#[from] std::io::Error),
19
20    #[error("Invalid configuration: {0}")]
21    InvalidConfig(String),
22}
23
24pub type Result<T> = std::result::Result<T, BusError>;