diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-01-22 14:59:34 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-01-23 12:15:47 +0100 |
commit | d01bb57a83b6dbef79e93639f784ee2ff6b72bf4 (patch) | |
tree | 081d6665dbff117c5b185560d8d54bf2801735a5 /tool/Cargo.toml | |
parent | d7f6a55911589af3c6f0c321330c59d2a3538ae6 (diff) |
Use the failure crate to handle errors.
- The failure crate is a young error handling solution for Rust. It
may change the API, but since we pin our dependencies, this should
not be a problem for us, albeit a bit inconvenient.
- Introduction of the crate is a bit noisy, but not as bad as
anticipated, because failure magically handles all errors used in
the standard library.
- Matching on concrete error values requires downcasting before
matching, which seems a bit unidiomatic. This is the cost of
using and "chaining" arbitrary error types. This is something
that may be improved later on in the library or language.
- Having said that, using the error type in the tool was nice. I
did not have to use a downcast, so maybe my worries about
downcasts are unjustified because it is not such a common use case
after all. On the other hand, the tool is quite simple and our
only mode of failure is to print the message.
Diffstat (limited to 'tool/Cargo.toml')
-rw-r--r-- | tool/Cargo.toml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/Cargo.toml b/tool/Cargo.toml index 276f4c7e..43864342 100644 --- a/tool/Cargo.toml +++ b/tool/Cargo.toml @@ -9,6 +9,7 @@ sequoia-core = { path = "../core" } sequoia-net = { path = "../net" } sequoia-store = { path = "../store" } clap = "2.27.1" +failure = "0.1.1" prettytable-rs = "0.6.7" time = "0.1.38" |