From b4f35d7f0b07b299cb26723ff436a5e46bf5b150 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Feb 2026 03:42:53 +0000 Subject: [PATCH] refactor(error): add From impl for Error Closes #319 --- crates/bashkit/src/error.rs | 4 ++++ crates/bashkit/src/tool.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/crates/bashkit/src/error.rs b/crates/bashkit/src/error.rs index edbc142d..901132c2 100644 --- a/crates/bashkit/src/error.rs +++ b/crates/bashkit/src/error.rs @@ -49,6 +49,10 @@ pub enum Error { #[error("network error: {0}")] Network(String), + /// Regex compilation or matching error. + #[error("regex error: {0}")] + Regex(#[from] regex::Error), + /// Internal error for unexpected failures. /// /// THREAT[TM-INT-002]: Unexpected internal failures should not crash the interpreter. diff --git a/crates/bashkit/src/tool.rs b/crates/bashkit/src/tool.rs index d52e4fe0..98078014 100644 --- a/crates/bashkit/src/tool.rs +++ b/crates/bashkit/src/tool.rs @@ -671,6 +671,7 @@ fn error_kind(e: &Error) -> String { Error::CommandNotFound(_) => "command_not_found".to_string(), Error::ResourceLimit(_) => "resource_limit".to_string(), Error::Network(_) => "network_error".to_string(), + Error::Regex(_) => "regex_error".to_string(), Error::Internal(_) => "internal_error".to_string(), } }