summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorfx <[email protected]>2023-05-29 18:02:08 +0200
committerfx <[email protected]>2023-05-29 18:02:08 +0200
commitd3870a2efa74e68c643dfb4aef32edc2536503b0 (patch)
tree116075aaa57c35afca2749719d450c3cb473ab3e /src/error.rs
parent5a2ea0755b29a8811aeeec1c73679c5783082628 (diff)
parentc7ecf3019a75dc0ab1a0aefeb9b880899fc8a231 (diff)
downloadmodlist-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.rs14
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 {
34impl fmt::Display for MLError { 34impl 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
107impl From<serde_json::error::Error> for MLError { 111impl 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
114impl MLError { 120impl MLError {