summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2022-12-27 11:46:22 +0100
committerFxQnLr <[email protected]>2022-12-27 11:46:22 +0100
commite1c79889d3bf02c8d131d642fed8ba7ef9521bf4 (patch)
tree82c9f375ecbcf4f51f7ff453b5f19299389eb178 /src
parent0515548682a95db643a008146105d8ecdb446e58 (diff)
downloadmodlist-e1c79889d3bf02c8d131d642fed8ba7ef9521bf4.tar
modlist-e1c79889d3bf02c8d131d642fed8ba7ef9521bf4.tar.gz
modlist-e1c79889d3bf02c8d131d642fed8ba7ef9521bf4.zip
some error stuff; version update
Diffstat (limited to 'src')
-rw-r--r--src/error.rs4
-rw-r--r--src/main.rs8
2 files changed, 9 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs
index 1ac2a48..192aa76 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -12,6 +12,7 @@ pub struct MLError {
12#[derive(Debug, Deserialize)] 12#[derive(Debug, Deserialize)]
13pub enum ErrorType { 13pub enum ErrorType {
14 ArgumentError, 14 ArgumentError,
15 ArgumentCountError,
15 ConfigError, 16 ConfigError,
16 LibToml, 17 LibToml,
17 IoError, 18 IoError,
@@ -26,7 +27,8 @@ impl std::error::Error for MLError {
26impl fmt::Display for MLError { 27impl fmt::Display for MLError {
27 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 28 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28 match self.etype { 29 match self.etype {
29 ErrorType::ArgumentError => write!(f, "ARGS"), 30 ErrorType::ArgumentError => write!(f, "Wrong argument"),
31 ErrorType::ArgumentCountError => write!(f, "Too many/too few arguments"),
30 ErrorType::ConfigError => write!(f, "CONFIG"), 32 ErrorType::ConfigError => write!(f, "CONFIG"),
31 ErrorType::LibToml => write!(f, "TOML"), 33 ErrorType::LibToml => write!(f, "TOML"),
32 ErrorType::IoError => write!(f, "IO") 34 ErrorType::IoError => write!(f, "IO")
diff --git a/src/main.rs b/src/main.rs
index a093bb7..a8aa15d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,6 +3,10 @@ use modlist::{config::Cfg, input::get_input};
3#[tokio::main] 3#[tokio::main]
4async fn main() { 4async fn main() {
5 let config = Cfg::init("config.toml").unwrap(); 5 let config = Cfg::init("config.toml").unwrap();
6 //TODO Error Handling 6 match get_input(config).await {
7 get_input(config).await.unwrap(); 7 Ok(..) => (),
8 Err(e) => {
9 println!("{}", e);
10 }
11 };
8} 12}