Skip to main content

spatialrust_sync/
error.rs

1//! Errors for sensor time and frame-graph operations.
2
3/// Result type for sync crate operations.
4pub type SyncResult<T> = Result<T, SyncError>;
5
6/// Failures in time sync, frame graphs, and replay.
7#[derive(Debug, thiserror::Error)]
8pub enum SyncError {
9    /// Invalid configuration.
10    #[error("invalid sync configuration: {0}")]
11    InvalidConfiguration(String),
12    /// A bounded episode would exceed one of its configured limits.
13    #[error("episode {resource} limit exceeded: requested {requested} with {current} already held (limit {limit})")]
14    EpisodeLimitExceeded {
15        /// Resource whose limit was exceeded.
16        resource: &'static str,
17        /// Resource amount requested by the next record.
18        requested: u64,
19        /// Resource amount already held by the builder.
20        current: u64,
21        /// Configured maximum resource amount.
22        limit: u64,
23    },
24    /// Missing frame or topic.
25    #[error("missing `{0}`")]
26    #[allow(dead_code)]
27    Missing(String),
28    /// No transform path between frames.
29    #[error("no transform path from `{from}` to `{to}`")]
30    NoTransformPath {
31        /// Source frame.
32        from: String,
33        /// Target frame.
34        to: String,
35    },
36    /// Wrapped records error.
37    #[error(transparent)]
38    Records(#[from] spatialrust_records::RecordsError),
39    /// Wrapped spatial error.
40    #[error(transparent)]
41    Spatial(#[from] spatialrust_core::SpatialError),
42    /// Filesystem / IO failure.
43    #[error("IO error: {0}")]
44    Io(String),
45    /// MCAP codec failure.
46    #[error("MCAP error: {0}")]
47    Mcap(String),
48}