The general advice is good (except for the awkward use of std error), so for anyone who wants to know what rustaceans are actually using:
- std error when it’s required
- anyhow for flexibly dealing with large classes of errors and rethrowing (often in bin crates or internally in a lib crate ), use anyhow::Context to tag errors
- thiserror for building and generating custom errors (in a lib crate)
- miette/eyre for more advanced features
Watch out for exposing error types in public API because then you are bound to push a breaking change if the upstream does.
Anyhow will probably never have a v2 at this point IMO, the entire Rust ecosystem might have to rev!
[EDIT] dont want to suggest that people avoid stackerror, just want to show what other ecosystem projects there are! stackerror seems to fit the hole of anyhow.