Skip to main content

behest_runtime/
error.rs

1//! Error types for the behest runtime.
2
3use behest_core::error::ProviderError;
4use thiserror::Error;
5
6/// Result type for runtime operations.
7pub type RuntimeResult<T> = std::result::Result<T, RuntimeError>;
8
9/// Errors produced by the runtime layer.
10#[derive(Debug, Error)]
11pub enum RuntimeError {
12    /// A provider returned an unrecoverable error.
13    #[error("provider error: {0}")]
14    Provider(#[from] ProviderError),
15
16    /// The run was cancelled.
17    #[error("run was cancelled")]
18    Cancelled,
19
20    /// Context building failed.
21    #[error("context error: {0}")]
22    Context(String),
23
24    /// Tool execution failed (aggregated).
25    #[error("tool execution error: {0}")]
26    Tool(String),
27
28    /// Memory operation failed.
29    #[error("memory error: {0}")]
30    Memory(String),
31}