remove lint ignore on BunBunError
This commit is contained in:
parent
ed462ba67e
commit
a8fba09955
2 changed files with 15 additions and 16 deletions
29
src/error.rs
29
src/error.rs
|
@ -2,13 +2,12 @@ use std::error::Error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
#[allow(clippy::enum_variant_names)]
|
|
||||||
pub enum BunBunError {
|
pub enum BunBunError {
|
||||||
IoError(std::io::Error),
|
Io(std::io::Error),
|
||||||
ParseError(serde_yaml::Error),
|
Parse(serde_yaml::Error),
|
||||||
WatchError(hotwatch::Error),
|
Watch(hotwatch::Error),
|
||||||
LoggerInitError(log::SetLoggerError),
|
LoggerInit(log::SetLoggerError),
|
||||||
CustomProgramError(String),
|
CustomProgram(String),
|
||||||
NoValidConfigPath,
|
NoValidConfigPath,
|
||||||
InvalidConfigPath(std::path::PathBuf, std::io::Error),
|
InvalidConfigPath(std::path::PathBuf, std::io::Error),
|
||||||
}
|
}
|
||||||
|
@ -18,11 +17,11 @@ impl Error for BunBunError {}
|
||||||
impl fmt::Display for BunBunError {
|
impl fmt::Display for BunBunError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::IoError(e) => e.fmt(f),
|
Self::Io(e) => e.fmt(f),
|
||||||
Self::ParseError(e) => e.fmt(f),
|
Self::Parse(e) => e.fmt(f),
|
||||||
Self::WatchError(e) => e.fmt(f),
|
Self::Watch(e) => e.fmt(f),
|
||||||
Self::LoggerInitError(e) => e.fmt(f),
|
Self::LoggerInit(e) => e.fmt(f),
|
||||||
Self::CustomProgramError(msg) => write!(f, "{}", msg),
|
Self::CustomProgram(msg) => write!(f, "{}", msg),
|
||||||
Self::NoValidConfigPath => write!(f, "No valid config path was found!"),
|
Self::NoValidConfigPath => write!(f, "No valid config path was found!"),
|
||||||
Self::InvalidConfigPath(path, reason) => {
|
Self::InvalidConfigPath(path, reason) => {
|
||||||
write!(f, "Failed to access {:?}: {}", path, reason)
|
write!(f, "Failed to access {:?}: {}", path, reason)
|
||||||
|
@ -43,7 +42,7 @@ macro_rules! from_error {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
from_error!(std::io::Error, IoError);
|
from_error!(std::io::Error, Io);
|
||||||
from_error!(serde_yaml::Error, ParseError);
|
from_error!(serde_yaml::Error, Parse);
|
||||||
from_error!(hotwatch::Error, WatchError);
|
from_error!(hotwatch::Error, Watch);
|
||||||
from_error!(log::SetLoggerError, LoggerInitError);
|
from_error!(log::SetLoggerError, LoggerInit);
|
||||||
|
|
|
@ -189,7 +189,7 @@ fn resolve_path(path: PathBuf, args: &str) -> Result<Vec<u8>, BunBunError> {
|
||||||
path.display(),
|
path.display(),
|
||||||
);
|
);
|
||||||
let error = String::from_utf8_lossy(&output.stderr);
|
let error = String::from_utf8_lossy(&output.stderr);
|
||||||
Err(BunBunError::CustomProgramError(error.to_string()))
|
Err(BunBunError::CustomProgram(error.to_string()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue