use thiserror::Error;
#[derive(Error, Debug)]
pub enum ForgeGuardError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("File not found: {0}")]
FileNotFound(String),
#[error("Invalid path: {0}")]
InvalidPath(String),
#[error("Parse error: {0}")]
Parse(String),
#[error("TOML parse error: {0}")]
Toml(#[from] toml::de::Error),
#[error("JSON parse error: {0}")]
Json(#[from] serde_json::Error),
#[error("Regex error: {0}")]
Regex(#[from] regex::Error),
#[error("Security check failed: {0}")]
SecurityCheck(String),
#[error("Critical vulnerability found: {0}")]
CriticalVulnerability(String),
#[error("Deployment blocked: {0}")]
DeploymentBlocked(String),
#[error("Analysis error: {0}")]
Analysis(String),
#[error("AST parsing error: {0}")]
AstParse(String),
#[error("Bytecode analysis error: {0}")]
BytecodeAnalysis(String),
#[error("Unsupported chain: {0}")]
UnsupportedChain(String),
#[error("RPC error: {0}")]
Rpc(String),
#[error("Plugin error: {0}")]
Plugin(String),
#[error("Plugin not found: {0}")]
PluginNotFound(String),
#[error("Plugin load error: {0}")]
PluginLoad(String),
#[error("Configuration error: {0}")]
Config(String),
#[error("Environment error: {0}")]
Env(String),
#[error("Cache error: {0}")]
Cache(String),
#[error("SQLite error: {0}")]
Sqlite(#[from] rusqlite::Error),
#[error("Command execution error: {0}")]
Command(String),
#[error("Subprocess error: {0}")]
Subprocess(String),
#[error("Timeout: {0}")]
Timeout(String),
#[error("Internal error: {0}")]
Internal(String),
#[error("Not implemented: {0}")]
NotImplemented(String),
#[error("{0}")]
Anyhow(#[from] anyhow::Error),
}
pub type Result<T> = std::result::Result<T, ForgeGuardError>;