Skip to main content

elizaos_plugin_shell/
error.rs

1#![allow(missing_docs)]
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum ShellError {
7    /// Shell is disabled
8    #[error("Shell plugin is disabled.")]
9    Disabled,
10
11    #[error("Invalid command: {0}")]
12    InvalidCommand(String),
13
14    #[error("Security policy violation: {0}")]
15    SecurityViolation(String),
16
17    #[error("Command is forbidden by security policy")]
18    ForbiddenCommand,
19
20    #[error("Cannot navigate outside allowed directory")]
21    PathValidationFailed,
22
23    #[error("Command execution failed: {0}")]
24    ExecutionFailed(String),
25
26    #[error("Command execution timeout")]
27    Timeout,
28
29    #[error("IO error: {0}")]
30    Io(#[from] std::io::Error),
31
32    #[error("Configuration error: {0}")]
33    Config(String),
34}
35
36pub type Result<T> = std::result::Result<T, ShellError>;