From b605614e5b3dab828e4f33c300836deab421be34 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Fri, 28 Aug 2020 18:44:45 -0700 Subject: Use anyhow for error handling This patch changes our error handling approach from the ground up: instead of having a globally used Error enum that contains variants for all possible errors, we now use anyhow's Error type. This approach is more dynamic (and not statically typed), but it allows for more fine grained error messages and overall more user-friendly error reporting. Overall it also is a net simplification. While we have one dynamic cast now, in order to be able to handle erroneous password/PIN entries correctly, that is considered a reasonable compromise. --- Cargo.lock | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index cb2bec3..f2f0675 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,6 +9,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "anyhow" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" + [[package]] name = "base32" version = "0.4.0" @@ -86,6 +92,7 @@ checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" name = "nitrocli" version = "0.3.3" dependencies = [ + "anyhow", "base32", "libc", "nitrokey", -- cgit v1.2.1