rust-lang-deprecated / failure

Error management
https://rust-lang-nursery.github.io/failure/
Apache License 2.0
1.42k stars 140 forks source link

Collaborate on a "core::Error" crate with snafu, anyhow and other error crates #328

Open roblabla opened 5 years ago

roblabla commented 5 years ago

With the recent proliferation of error-handling crates, it has become clear that the situation around the lack of a core::error::Error is really suboptimal. In snafu, no_std support is being introduced through a whole new Error trait just for no_std - which could lead to similar problems that failure had by becoming incompatible with the ecosystem.

Ideally, the Error trait would show up in core, but due to coherence concerns and std-dependent features being added to std::error::Error, a resolution is unlikely to happen soon. As such, I propose making a new crate, core-error - exposing our own version of the Error trait. The goal of this crate is twofolds:

Such a crate would work like this:

The trait will be compatible with std's Error trait, and if libcore gains an Error trait in the future, it should be compatible with it too.

Once the crate reaches 1.0.0, I'll consider it ready for integration in the various error crates and will follow the same stability guarantee Rust does: No breaking changes ever.

Work has already started in https://github.com/core-error/core-error. I'd be interested in hearing feedback on the design.

davidbarsky commented 4 years ago

I'm onboard with a core-error, but I don't really have the bandwidth to provide feedback at the moment. Once it reaches 1.0—personally speaking—I think it ought be integrated with Failure!