use std::time::Duration;
#[derive(Debug, thiserror::Error)]
pub enum SandboxError {
#[error("Docker not available: {reason}")]
DockerNotAvailable { reason: String },
#[error("Container creation failed: {reason}")]
ContainerCreationFailed { reason: String },
#[error("Container start failed: {reason}")]
ContainerStartFailed { reason: String },
#[error("Execution failed: {reason}")]
ExecutionFailed { reason: String },
#[error("Command timed out after {0:?}")]
Timeout(Duration),
#[error("Resource limit exceeded: {resource} limit of {limit}")]
ResourceLimitExceeded { resource: String, limit: String },
#[error("Proxy error: {reason}")]
ProxyError { reason: String },
#[error("Network request blocked: {reason}")]
NetworkBlocked { reason: String },
#[error("Credential injection failed for {domain}: {reason}")]
CredentialInjectionFailed { domain: String, reason: String },
#[error("Docker API error: {0}")]
Docker(#[from] bollard::errors::Error),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Configuration error: {reason}")]
Config { reason: String },
}
pub type Result<T> = std::result::Result<T, SandboxError>;