remove nonsense errortypes
This commit is contained in:
parent
f80d2a9c1d
commit
ce7866df09
@ -12,6 +12,6 @@ clap = { version = "4.5.4", features = ["derive"] }
|
||||
serde = { version = "1.0.197", features = ["derive"] }
|
||||
serde_derive = { version = "1.0.197" }
|
||||
num_cpus = "1.16.0"
|
||||
fern = {version = "0.6.2", features = ["colored"]}
|
||||
fern = { version = "0.6.2", features = ["colored"] }
|
||||
log = "0.4.21"
|
||||
humantime = "2.1.0"
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
use std::io;
|
||||
|
||||
use crate::errors::ErrorType;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ConfigError {
|
||||
Arguments(clap::error::Error),
|
||||
ConfigFile(io::Error),
|
||||
Merging(String)
|
||||
}
|
||||
|
||||
impl ConfigError {
|
||||
fn throw(self) -> ErrorType {
|
||||
match self {
|
||||
Self::Arguments(error) => {
|
||||
ErrorType::new(
|
||||
"Parsing Arguments".to_string(),
|
||||
error.to_string(),
|
||||
false
|
||||
)
|
||||
},
|
||||
Self::ConfigFile(error) => {
|
||||
ErrorType::new(
|
||||
"Reading Config File".to_string(),
|
||||
error.to_string(),
|
||||
false
|
||||
)
|
||||
},
|
||||
Self::Merging(error) => {
|
||||
ErrorType::new(
|
||||
"Reading Config File".to_string(),
|
||||
error,
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,8 +5,6 @@ mod engine;
|
||||
|
||||
use crate::logging::logger_init;
|
||||
|
||||
pub mod error;
|
||||
|
||||
|
||||
|
||||
use self::{args::Args, config::Config};
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
use crate::config::error::ConfigError;
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ErrorType {
|
||||
kind: String,
|
||||
message: String,
|
||||
fatal: bool
|
||||
}
|
||||
|
||||
impl ErrorType {
|
||||
pub fn new(kind: String, message: String, fatal: bool) -> Self {
|
||||
ErrorType { kind, message, fatal }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum SaltfishError {
|
||||
ConfigError(ConfigError)
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ use log::trace;
|
||||
|
||||
mod chess;
|
||||
mod config;
|
||||
mod errors;
|
||||
mod logging;
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user