claude_agent/security/sandbox/
error.rs

1//! Sandbox error types.
2
3use std::io;
4use std::path::PathBuf;
5
6use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum SandboxError {
10    #[error("sandbox not supported on this platform")]
11    NotSupported,
12
13    #[error("sandbox not available: {0}")]
14    NotAvailable(String),
15
16    #[error("failed to create sandbox: {0}")]
17    Creation(String),
18
19    #[error("failed to apply sandbox rules: {0}")]
20    RuleApplication(String),
21
22    #[error("path not accessible: {}", .0.display())]
23    PathNotAccessible(PathBuf),
24
25    #[error("invalid sandbox configuration: {0}")]
26    InvalidConfig(String),
27
28    #[error("sandbox profile error: {0}")]
29    Profile(String),
30
31    #[error("io error: {0}")]
32    Io(#[from] io::Error),
33}
34
35pub type SandboxResult<T> = Result<T, SandboxError>;