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 ] `ContextCompat` contains identically named methods to `WrapErr` which can be confusing and a footgun #149

Closed ten3roberts closed 2 months ago

ten3roberts commented 7 months ago

This can be confusing as you can't tell which method is being called.

It also leads to a backwards compatability hazard for conditional trait methods, though these are currently alleviated by virtue of the trait being sealed.

Additionally, WrapErr also exposes anyhow compatibility methods like context, which leads to the same confusion and footguns in the other direction.

This has lead to misunderstandings, poor reasonability, as well as mistakes in code where we called the wrong method.

Consider making anyhow compatibility consistent under one trait.

ten3roberts commented 7 months ago

Related: #147 and https://github.com/eyre-rs/eyre/pull/138#discussion_r1432909562