// Source: /data/home/swei/claudecode/openclaudecode/src/utils/errors.ts
pub fn error_message(error: &dyn std::error::Error) -> String {
error.to_string()
}
pub fn to_error<T: std::fmt::Display>(err: T) -> std::boxed::Box<dyn std::error::Error> {
std::boxed::Box::new(err.to_string())
}
pub fn is_enoent(error: &dyn std::error::Error) -> bool {
error
.downcast_ref::<std::io::Error>()
.map(|e| e.kind() == std::io::ErrorKind::NotFound)
.unwrap_or(false)
}