Skip to main content

agentcontract/
errors.rs

1//! Error types for agentcontract-rs.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum ContractError {
7    #[error("Failed to load contract: {0}")]
8    LoadError(String),
9
10    #[error("Contract validation error: {0}")]
11    ValidationError(String),
12}
13
14/// Raised when a blocking violation occurs.
15#[derive(Debug, Error)]
16#[error("ContractViolation: {message}")]
17pub struct ContractViolation {
18    pub message: String,
19    pub violations: Vec<String>,
20}