Use anyhow for error handling

Summary:
This is a nice solution if you don't want to spend
too much time thinking about error handling.
You have one common return type and can basically use `?`
everywhere while still maintaining the flexibility to
create custom error types where needed.

Reviewed By: jknoxville

Differential Revision: D21349046

fbshipit-source-id: 073539ce8422cdb3e0141886e95321052bc0c7a3
This commit is contained in:
Pascal Hartig
2020-05-01 09:41:13 -07:00
committed by Facebook GitHub Bot
parent 6f9d82117e
commit 2c20f016d4
4 changed files with 20 additions and 17 deletions

7
packer/Cargo.lock generated
View File

@@ -9,6 +9,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "anyhow"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9a60d744a80c30fcb657dfe2c1b22bcb3e814c1a1e3674f32bf5820b570fbff"
[[package]]
name = "arrayref"
version = "0.3.6"
@@ -143,6 +149,7 @@ dependencies = [
name = "flipper-packer"
version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"serde",
"serde_yaml",