rust-secure-code / cargo-supply-chain

Gather author, contributor and publisher data on crates in your dependency graph.
Apache License 2.0
313 stars 18 forks source link

Migrate to `anyhow` crate for error handling #74

Closed Shnatsel closed 2 years ago

Shnatsel commented 2 years ago

Right now we have the err_exit function that just prints the error and exits:

https://github.com/rust-secure-code/cargo-supply-chain/blob/11516a20032be39a41ad08894357752f263b7253/src/main.rs#L235-L243

This makes code difficult to test, because it just exits the testing process on error. We should return errors instead.

The anyhow crate makes that rather easy, and is low on supply chain sprawl (unlike something like color-eyre).