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` (`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//! - [`AiInferenceError`] / [`McpRegistryError`] — the typed errors of the
18//!   dyn-dispatched provider seams.
19//! - [`ServiceError`] — application-tier umbrella enum.
20//!
21//! Copyright (c) systemprompt.io — Business Source License 1.1.
22//! See <https://systemprompt.io> for licensing details.
23
24pub use systemprompt_traits::RepositoryError;
25
26pub mod macros;
27mod metadata;
28mod parse;
29mod provider;
30mod row;
31mod secrets;
32mod service;
33mod validation;
34
35pub use metadata::MetadataError;
36pub use parse::{ConfigError, ParseEnumError};
37pub use provider::{AiInferenceError, AiInferenceResult, McpRegistryError, McpRegistryResult};
38pub use row::RowParseError;
39pub use secrets::SecretsError;
40pub use service::ServiceError;
41pub use validation::ConfigValidationError;