konnektoren_core/controller/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ControllerError {
5    #[error("Game state error: {0}")]
6    GameState(String),
7
8    #[error("Persistence error: {0}")]
9    Persistence(#[from] crate::persistence::PersistenceError),
10
11    #[error("Command execution error: {0}")]
12    CommandExecution(#[from] crate::commands::CommandError),
13
14    #[error("Plugin error: {0}")]
15    Plugin(#[from] crate::controller::ControllerPluginError),
16
17    #[error("State lock error")]
18    StateLock,
19
20    #[error("Invalid state: {0}")]
21    InvalidState(String),
22}
23
24pub type Result<T> = std::result::Result<T, ControllerError>;