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`], [`GlobalConfigError`] — string parsing failures.
13//! - [`ServicesValidationError`] — services / agents / plugins validation.
14//! - [`MetadataError`] — MCP `_meta` payload decoding.
15//! - [`SecretsError`] — on-disk secrets document.
16//! - [`AiInferenceError`] / [`McpRegistryError`] — the typed errors of the AI
17//! provider and MCP registry seams.
18//! - [`RepositoryError`] — the workspace's single repository error, defined in
19//! `systemprompt-traits`; it renders over HTTP through
20//! [`crate::api::ApiError`]'s `From` impl.
21//!
22//! Copyright (c) systemprompt.io — Business Source License 1.1.
23//! See <https://systemprompt.io> for licensing details.
24
25pub use systemprompt_traits::RepositoryError;
26
27pub mod macros;
28mod metadata;
29mod parse;
30mod provider;
31mod secrets;
32mod validation;
33
34pub use metadata::MetadataError;
35pub use parse::{GlobalConfigError, ParseEnumError};
36pub use provider::{AiInferenceError, AiInferenceResult, McpRegistryError, McpRegistryResult};
37pub use secrets::SecretsError;
38pub use validation::ServicesValidationError;