Skip to content

error-stack: Use along with or replacing thiserror? #736

Discussion options

You must be logged in to vote

Hi @dpc!

The main difference between library-type errors and application-type errors is how it's exposed. thiserror does not appear in the public API of a crate, which makes it incredibly useful for libraries (NB: derive(Error) from thiserror is not limited to enums). Downstream crates depending on thiserror can use the returned error like any other Error. Application-type errors like anyhow or eyre do appear in the public API. Additionally, error types from application-type errors usually don't implement Error (but usually implement a way returning a &dyn Error like using AsRef<&dyn Error>).

error_stack::Report does not (and will not) implement Error. However, we plan to implement a way …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TimDiekmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs > error-stack Affects the `error-stack` crate (library) area/libs Relates to first-party libraries/crates/packages (area)
2 participants