aboutsummaryrefslogtreecommitdiff
path: root/Cargo.toml
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-10-07 23:19:31 +0200
committerDaniel Schadt <kingdread@gmx.de>2021-10-07 23:19:31 +0200
commit8510ed3e43ff0a92565815b02645cc7bf5cb6b18 (patch)
tree7dc820e537583705099cf1f77b8a49e100b9a64d /Cargo.toml
parentcd110bcc5db993ae329d85674590f9a453014f8c (diff)
downloadkondou-8510ed3e43ff0a92565815b02645cc7bf5cb6b18.tar.gz
kondou-8510ed3e43ff0a92565815b02645cc7bf5cb6b18.tar.bz2
kondou-8510ed3e43ff0a92565815b02645cc7bf5cb6b18.zip
Modernize error handling
This sprinkles in some thiserror and anyhow instead of the hand-rolled 'error_froms!' macros and the MainResult. The benefit of this is that we're hooking into an established ecosystem of error handling and we're saving a lot of effort in the hand-written Display and Error implementations. The reason for not sprinkling anyhow everywhere is because the retrieval/rendering part of kondou could be split off into a library at some point, in which case we want to have a proper KondouError type. However, the argument could be made that the current split of errors is not very good, especially because many of them boil down to the same inner errors (RenderError wrapping ApiError wrapping reqwest::Error), which keeps unnecessary information. Some future improvements may include 1.) Unifying those error enums into one bigger enum 2.) Attaching more context through anyhow in the application layer 3.) Properly define an API and split off the inner logic from the UI logic
Diffstat (limited to 'Cargo.toml')
-rw-r--r--Cargo.toml2
1 files changed, 2 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index ec6cf67..df5ca0e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,3 +23,5 @@ num_enum = "0.5.4"
num-traits = "0.2"
byteorder = "1.3"
toml = "0.5"
+anyhow = "1.0.44"
+thiserror = "1.0.29"