pub enum Error {
ToolchainMissing {
tool: String,
source: Option<Box<dyn Error + Send + Sync>>,
fixes: Vec<Fix>,
},
ToolchainMismatch {
tool: String,
expected: String,
found: String,
fixes: Vec<Fix>,
},
Config {
message: String,
path: Option<PathBuf>,
source: Option<Box<dyn Error + Send + Sync>>,
fixes: Vec<Fix>,
},
Io {
message: String,
path: Option<PathBuf>,
source: Error,
},
CommandFailed {
command: String,
exit_code: Option<i32>,
stdout: String,
stderr: String,
fixes: Vec<Fix>,
},
BuildFailed {
errors: Vec<String>,
fixes: Vec<Fix>,
},
Lock {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
fixes: Vec<Fix>,
},
ProjectNotFound {
searched: Vec<PathBuf>,
fixes: Vec<Fix>,
},
Other(Error),
}Expand description
Structured error type for hx.
Variants§
ToolchainMissing
ToolchainMismatch
Config
Fields
Io
CommandFailed
BuildFailed
Lock
ProjectNotFound
Other(Error)
Implementations§
Source§impl Error
impl Error
Sourcepub fn config_at(message: impl Into<String>, path: impl Into<PathBuf>) -> Self
pub fn config_at(message: impl Into<String>, path: impl Into<PathBuf>) -> Self
Create a config error with a path.
Sourcepub fn toolchain_missing(tool: impl Into<String>) -> Self
pub fn toolchain_missing(tool: impl Into<String>) -> Self
Create a toolchain missing error with default fix suggestions.
Sourcepub fn toolchain_mismatch(
tool: impl Into<String>,
expected: impl Into<String>,
found: impl Into<String>,
) -> Self
pub fn toolchain_mismatch( tool: impl Into<String>, expected: impl Into<String>, found: impl Into<String>, ) -> Self
Create a toolchain mismatch error with default fix suggestions.
Sourcepub fn project_not_found(searched: Vec<PathBuf>) -> Self
pub fn project_not_found(searched: Vec<PathBuf>) -> Self
Create a project not found error with helpful suggestions.
Sourcepub fn lock_outdated() -> Self
pub fn lock_outdated() -> Self
Create a lock error with suggestions.
Sourcepub fn build_failed(errors: Vec<String>) -> Self
pub fn build_failed(errors: Vec<String>) -> Self
Create a build failed error with common suggestions.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more