Skip to main content

nexara_core/
error.rs

1use thiserror::Error;
2
3pub type NexaraResult<T> = Result<T, NexaraError>;
4
5#[derive(Debug, Error, Clone, PartialEq, Eq)]
6pub enum NexaraError {
7    #[error("tool not found")]
8    ToolNotFound,
9    #[error("tool not allowed")]
10    ToolNotAllowed,
11    #[error("trust policy denied: {0}")]
12    TrustPolicyDenied(String),
13    #[error("confirmation required: {0}")]
14    ConfirmationRequired(String),
15    #[error("invalid params: {0}")]
16    InvalidParams(String),
17    #[error("service unavailable: {0}")]
18    ServiceUnavailable(String),
19    #[error("execution failed: {0}")]
20    ExecutionFailed(String),
21    #[error("payload too large: {0} bytes")]
22    PayloadTooLarge(usize),
23    #[error("concurrency limit exceeded")]
24    ConcurrencyLimitExceeded,
25    #[error("invalid descriptor: {0}")]
26    InvalidDescriptor(String),
27}