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.34k stars 63 forks source link

DISCUSS: merge eyre and anyhow libraries #177

Open ten3roberts opened 2 months ago

ten3roberts commented 2 months ago

Eyre is a close clone of anyhow which aims to provide extra configurabilities and more dynamic features compared to anyhow.

The library has been able to achieve its purpose and provide more elaborate error handling.

However, there has been compatibility issues and fragmentation arising when mixing the use of the libraries, most often due to external crates or ecosystem conventions. It is not easy to mix the usage of convert between anyhow::Error and eyre::Report and preserve the backtrace and other data.

Numerous attempts, issues and discussions have been related to this topic

31

171

Backtrace preserving conversion PR

The discussed solution has been to rethink our approach and reconcile the two libarier, providing a hook similar to the log crate in anyhow, and making eyre and most notably color-eyre integrate with anyhow directly, allowing the community to use both libraries together rather than fighting the chasm.

Any feedback is more than welcome

joshtriplett commented 2 months ago

Discussion and plans in this regard may also want to consider the possibility of getting a subset of eyre's functionality merged into the standard library.