Skip to main content

systemprompt_models/managed/
error.rs

1//! Failures raised while validating or verifying a revision closure.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use systemprompt_identifiers::ResourceRevisionId;
7
8#[derive(Debug, thiserror::Error)]
9pub enum RevisionBundleError {
10    #[error("Invalid managed resource: {0}")]
11    Invalid(String),
12    #[error("Managed resource integrity check failed")]
13    Integrity,
14    #[error("Revision {0} is not part of the bundle")]
15    MissingRevision(ResourceRevisionId),
16    #[error("Managed resource serialization failed: {0}")]
17    Json(#[from] serde_json::Error),
18}
19
20pub(super) fn invalid(message: &str) -> RevisionBundleError {
21    RevisionBundleError::Invalid(message.to_owned())
22}