Skip to main content

skiagram_core/
error.rs

1//! Typed errors for skiagram-core. The binary wraps these with `anyhow` context.
2
3use std::path::PathBuf;
4use thiserror::Error;
5
6/// Errors produced by core operations.
7#[derive(Debug, Error)]
8pub enum CoreError {
9    /// A session file could not be opened/read at all (per-line corruption is
10    /// NOT an error — parsers skip bad lines leniently).
11    #[error("failed to read {path}")]
12    Io {
13        path: PathBuf,
14        #[source]
15        source: std::io::Error,
16    },
17
18    /// `--agent` named an adapter that does not exist.
19    #[error("unknown agent id `{requested}` (known: {known})")]
20    UnknownAgent { requested: String, known: String },
21}