remove nonsense errortypes
This commit is contained in:
parent
f80d2a9c1d
commit
ce7866df09
@ -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;
|
use crate::logging::logger_init;
|
||||||
|
|
||||||
pub mod error;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use self::{args::Args, config::Config};
|
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 chess;
|
||||||
mod config;
|
mod config;
|
||||||
mod errors;
|
|
||||||
mod logging;
|
mod logging;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user