eyre-rs / eyre

A trait object based error handling type for easy idiomatic error handling and reporting in Rust applications
Apache License 2.0
1.35k stars 63 forks source link

[breaking] Remove `anyhow` from default features #136

Open LeoniePhiline opened 8 months ago

LeoniePhiline commented 8 months ago

131 introduces a new anyhow default feature flag to allow users to hide aliased exports such as eyre::Error and eyre::Context.

This issue tracks the removal of anyhow from the list of default features, making the compatibility layer with the anyhow crate opt-in.

LeoniePhiline commented 7 months ago

Update: This change is planned to go into the next breaking release, since introducing a (default) anyhow feature flag ended up being an unintended breaking change.

@ten3roberts responded to my question "Since it's a breaking change anyway, shall we then remove it from default features right away?" with:

Absolutely, that would be great.

It would further go into our intents of making the error wrapping represent a logical error chain, rather than context attached to an error. The anyhow compatibility has unfortunately incentivized the latter approach where through API naming the error chains are treated like context stores where you can interpolate arbitrary data, such as usernames or other variables.

Making it opt-in would thus be awesome, and push towards a more descriptive chain of errors.

Do you mind opening a PR with a short explanation in the Readme of what it means and how to opt in/how it compares to anyhow?

LeoniePhiline commented 6 months ago

Status: Waiting for https://github.com/eyre-rs/eyre/issues/149 due to some thematic overlap.