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 /core/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 'core/Cargo.toml')
-rw-r--r-- | core/Cargo.toml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index caafe03c..1bfb5222 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -4,4 +4,5 @@ version = "0.1.0" authors = ["Justus Winter <justus@pep-project.org>"] [dependencies] +failure = "0.1.1" tempdir = "0.3.5" |