jedisct1 / rsign2

A command-line tool to sign files and verify signatures in pure Rust.
MIT License
127 stars 11 forks source link

Consider migrating to `anyhow` for error handling #7

Closed tiziano88 closed 1 year ago

tiziano88 commented 4 years ago

https://docs.rs/anyhow/1.0.31/anyhow/

tiziano88 commented 4 years ago

Happy to look into this myself if there is interest in merging.

jedisct1 commented 4 years ago

Hi!

We don't have a lot of errors, and they are very simple.

So I rather not introduce a breaking change and an additional dependency with no real benefits.

tiziano88 commented 4 years ago

No problem, understandable. The downside of piling up on the minisign::* types for errors is that they don't necessarily make sense at application level. For instance, in my own PR, I had to create a PError and try to match its format instead of a more convenient type (e.g. anyhow::Result) that is more idiomatic for logging and preserves context. Anyway, your call of course, perhaps worth reconsidering later on.

Keep up the good work!

tiziano88 commented 4 years ago

Just in case it was not clear: I was suggesting this only for the binary crate of course, not for the library.

jedisct1 commented 4 years ago

Good point!

This will be useful if the binary gets a little bit bigger and more complex, but right now, it's just a small wrapper around the library that is unlikely to change much.

So, maybe we can wait for the next error handling crate :)