systemprompt_models/errors/mod.rs
1//! Cross-cutting error types for `systemprompt-models`.
2//!
3//! This module hosts `thiserror`-derived enums returned by the public
4//! surface of this crate. Public APIs never return `anyhow::Error`; they
5//! convert to one of the typed enums declared here. Downstream entry
6//! crates that use `anyhow` (`entry/cli`, `entry/api`) continue to consume
7//! these errors transparently via `?` because every enum implements
8//! `std::error::Error`.
9//!
10//! Public re-exports:
11//!
12//! - [`ParseEnumError`], [`ConfigError`] — string parsing failures.
13//! - [`ConfigValidationError`] — services / agents / plugins validation.
14//! - [`RowParseError`] — JSON-row deserialization failures.
15//! - [`MetadataError`] — MCP `_meta` payload decoding.
16//! - [`SecretsError`] — on-disk secrets document.
17//! - [`ProviderError`] / [`ProviderResult`] — plug-in trait abstractions.
18//! - [`CoreError`] — legacy umbrella enum with HTTP status mapping.
19//! - [`ServiceError`] — application-tier umbrella enum.
20
21pub use systemprompt_traits::RepositoryError;
22
23mod core;
24pub mod macros;
25mod metadata;
26mod parse;
27mod provider;
28mod row;
29mod secrets;
30mod service;
31mod validation;
32
33pub use core::CoreError;
34pub use metadata::MetadataError;
35pub use parse::{ConfigError, ParseEnumError};
36pub use provider::{ProviderError, ProviderResult};
37pub use row::RowParseError;
38pub use secrets::SecretsError;
39pub use service::ServiceError;
40pub use validation::ConfigValidationError;