Skip to main content

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` continue to consume these errors transparently
7//! via `?` because every enum implements `std::error::Error`.
8//!
9//! Public re-exports:
10//!
11//! - [`ParseEnumError`], [`ConfigError`] — string parsing failures.
12//! - [`ConfigValidationError`] — services / agents / plugins validation.
13//! - [`RowParseError`] — JSON-row deserialization failures.
14//! - [`MetadataError`] — MCP `_meta` payload decoding.
15//! - [`SecretsError`] — on-disk secrets document.
16//! - [`ProviderError`] / [`ProviderResult`] — plug-in trait abstractions.
17//! - [`CoreError`] — legacy umbrella enum with HTTP status mapping.
18//! - [`ServiceError`] — application-tier umbrella enum.
19
20pub use systemprompt_traits::RepositoryError;
21
22mod core;
23pub mod macros;
24mod metadata;
25mod parse;
26mod provider;
27mod row;
28mod secrets;
29mod service;
30mod validation;
31
32pub use core::CoreError;
33pub use metadata::MetadataError;
34pub use parse::{ConfigError, ParseEnumError};
35pub use provider::{ProviderError, ProviderResult};
36pub use row::RowParseError;
37pub use secrets::SecretsError;
38pub use service::ServiceError;
39pub use validation::ConfigValidationError;