diff options
author | fx <[email protected]> | 2023-05-29 18:02:08 +0200 |
---|---|---|
committer | fx <[email protected]> | 2023-05-29 18:02:08 +0200 |
commit | d3870a2efa74e68c643dfb4aef32edc2536503b0 (patch) | |
tree | 116075aaa57c35afca2749719d450c3cb473ab3e /src/error.rs | |
parent | 5a2ea0755b29a8811aeeec1c73679c5783082628 (diff) | |
parent | c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231 (diff) | |
download | modlist-d3870a2efa74e68c643dfb4aef32edc2536503b0.tar modlist-d3870a2efa74e68c643dfb4aef32edc2536503b0.tar.gz modlist-d3870a2efa74e68c643dfb4aef32edc2536503b0.zip |
Merge pull request 'multithreaded' (#6) from multithreaded into master
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/6
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/error.rs b/src/error.rs index e6afeaa..a2b37a8 100644 --- a/src/error.rs +++ b/src/error.rs | |||
@@ -34,8 +34,12 @@ impl std::error::Error for MLError { | |||
34 | impl fmt::Display for MLError { | 34 | impl fmt::Display for MLError { |
35 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | 35 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
36 | match self.etype { | 36 | match self.etype { |
37 | ErrorType::ArgumentError => write!(f, "User input not accepted: {}", self.message), | 37 | ErrorType::ArgumentError => { |
38 | ErrorType::ArgumentCountError => write!(f, "Too many/too few arguments"), | 38 | write!(f, "User input not accepted: {}", self.message) |
39 | } | ||
40 | ErrorType::ArgumentCountError => { | ||
41 | write!(f, "Too many/too few arguments") | ||
42 | } | ||
39 | ErrorType::ConfigError => write!(f, "CONFIG"), | 43 | ErrorType::ConfigError => write!(f, "CONFIG"), |
40 | ErrorType::DBError => write!(f, "Database: {}", self.message), | 44 | ErrorType::DBError => write!(f, "Database: {}", self.message), |
41 | ErrorType::ModError => write!(f, "Mod: {}", self.message), | 45 | ErrorType::ModError => write!(f, "Mod: {}", self.message), |
@@ -106,9 +110,11 @@ impl From<std::io::Error> for MLError { | |||
106 | 110 | ||
107 | impl From<serde_json::error::Error> for MLError { | 111 | impl From<serde_json::error::Error> for MLError { |
108 | fn from(value: serde_json::error::Error) -> Self { | 112 | fn from(value: serde_json::error::Error) -> Self { |
109 | Self { etype: ErrorType::LibJson, message: value.to_string() } | 113 | Self { |
114 | etype: ErrorType::LibJson, | ||
115 | message: value.to_string(), | ||
116 | } | ||
110 | } | 117 | } |
111 | |||
112 | } | 118 | } |
113 | 119 | ||
114 | impl MLError { | 120 | impl MLError { |