Skip to main content

dasein_agentic_core/
error.rs

1//! Agent error types.
2
3use thiserror::Error;
4
5/// Errors that can occur during agent operations.
6#[derive(Error, Debug)]
7pub enum AgentError {
8    /// LLM is not available
9    #[error("LLM not available")]
10    LLMNotAvailable,
11
12    /// Sandbox is not ready
13    #[error("Sandbox not ready")]
14    SandboxNotReady,
15
16    /// Sandbox is required but not configured
17    #[error("Sandbox required for execution but not configured")]
18    SandboxRequired,
19
20    /// LLM error
21    #[error("LLM error: {0}")]
22    LLMError(String),
23
24    /// Sandbox error
25    #[error("Sandbox error: {0}")]
26    SandboxError(#[from] dasein_agentic_sandbox::SandboxError),
27
28    /// Task execution failed
29    #[error("Task execution failed: {0}")]
30    ExecutionFailed(String),
31
32    /// Agent is already running
33    #[error("Agent is already running")]
34    AlreadyRunning,
35
36    /// Agent is not running
37    #[error("Agent is not running")]
38    NotRunning,
39
40    /// Timeout
41    #[error("Operation timed out")]
42    Timeout,
43
44    /// Invalid task
45    #[error("Invalid task: {0}")]
46    InvalidTask(String),
47}