use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum RsbuildError {
#[error("Required tool '{tool}' is not installed. {hint}")]
ToolNotFound {
tool: String,
hint: String,
},
#[error("Command failed: {command}\n Exit code: {code}\n Error: {message}")]
CommandFailed {
command: String,
code: i32,
message: String,
},
#[error("Failed to execute command: {0}")]
ExecutionFailed(String),
#[error("Path not found: {path}")]
PathNotFound {
path: PathBuf,
},
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("UTF-8 conversion error: {0}")]
Utf8(#[from] std::string::FromUtf8Error),
}
pub type Result<T> = std::result::Result<T, RsbuildError>;