opsis_core/error.rs
1use thiserror::Error;
2
3/// Errors produced by the Opsis world state engine.
4#[derive(Debug, Error)]
5pub enum OpsisError {
6 /// A feed failed to connect or poll.
7 #[error("feed error: {0}")]
8 Feed(String),
9
10 /// Serialization / deserialization failure.
11 #[error("serialization error: {0}")]
12 Serialization(String),
13
14 /// Invalid spatial data (coordinates out of range, etc.).
15 #[error("spatial error: {0}")]
16 Spatial(String),
17
18 /// Subscription matching or registration error.
19 #[error("subscription error: {0}")]
20 Subscription(String),
21
22 /// The engine is not running or has shut down.
23 #[error("engine not running")]
24 EngineNotRunning,
25}
26
27/// Convenience alias used throughout the crate.
28pub type OpsisResult<T> = Result<T, OpsisError>;