arbiter_engine/
errors.rs

1//! Error types for the arbiter engine.
2
3use thiserror::Error;
4
5use super::*;
6
7/// Errors that can occur in the arbiter engine.
8#[derive(Debug, Error)]
9pub enum ArbiterEngineError {
10    /// Error occurred with the [`Messager`].
11    #[error("MessagerError: {0}")]
12    MessagerError(String),
13
14    /// Error occurred with the [`crate::agent::Agent`].
15    #[error("AgentBuildError: {0}")]
16    AgentBuildError(String),
17
18    /// Error occurred with the [`crate::world::World`].
19    #[error("WorldError: {0}")]
20    WorldError(String),
21
22    /// Error occurred with the [`crate::universe::Universe`].
23    #[error("UniverseError: {0}")]
24    UniverseError(String),
25
26    /// Error occurred in joining a task.
27    #[error(transparent)]
28    JoinError(#[from] tokio::task::JoinError),
29
30    /// Error occurred in sending a message.
31    #[error(transparent)]
32    SendError(#[from] tokio::sync::broadcast::error::SendError<crate::messager::Message>),
33
34    /// Error occurred in deserializing json.
35    #[error(transparent)]
36    SerdeJsonError(#[from] serde_json::Error),
37
38    /// Error occurred in reading in a file.
39    #[error(transparent)]
40    IoError(#[from] std::io::Error),
41
42    /// Error occurred in deserializing toml.
43    #[error(transparent)]
44    TomlError(#[from] toml::de::Error),
45
46    /// Error occurred within [`arbiter_core`].
47    #[error(transparent)]
48    ArbiterCoreError(#[from] arbiter_core::errors::ArbiterCoreError),
49}