Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Use Failure crate to enhance error handling #7077

Closed
0x7CFE opened this issue Nov 17, 2017 · 4 comments
Closed

Use Failure crate to enhance error handling #7077

0x7CFE opened this issue Nov 17, 2017 · 4 comments
Labels
F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.
Milestone

Comments

@0x7CFE
Copy link
Contributor

0x7CFE commented Nov 17, 2017

Failure crate reflects new approach to error handling in Rust.

It natively supports backtraces, error downcasting, and is backward compatible with io::Error through blanket impl. Detailed information, as well as various use cases may be found in documentation.

I think, we may consider migrating to this crate once it became stable enough.

@0x7CFE 0x7CFE added F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. labels Nov 17, 2017
@debris
Copy link
Collaborator

debris commented Nov 17, 2017

It looks interesting. Do you know if it supposed to be complementary to error_chain or is it supposed to be a replacement for it?

@0x7CFE
Copy link
Contributor Author

0x7CFE commented Nov 17, 2017

Failure was intentionally designed to be backwards compatible with std. If I understood correctly, it may operate with other error types within a single crate without much pain.

Regarding error_chain interoperability, I believe, it would be supported someday. Right now it may be achieved using the standard Error trait, but maybe later we would have some specific options.

The very same question was asked on recent Bay Area meetup. You may check the video at 1:43:30.

@5chdn 5chdn added the P5-sometimesoon 🌲 Issue is worth doing soon. label Nov 17, 2017
@5chdn 5chdn added this to the 1.10 milestone Nov 17, 2017
@debris debris modified the milestones: 1.10, 1.11 & ... Nov 18, 2017
@5chdn 5chdn modified the milestones: 1.11 & ..., 1.12 & ... Jan 23, 2018
@0x7CFE
Copy link
Contributor Author

0x7CFE commented Feb 23, 2018

It is expected, that Failure would hit 1.0.0 on March 15.

I think it's a good time to reconsider, whether we want adopting it in the near future (at least for a new code).

@0x7CFE 0x7CFE unassigned debris and arkpar Feb 25, 2018
@5chdn 5chdn modified the milestones: 1.12, 1.13 & ... Mar 1, 2018
@5chdn 5chdn modified the milestones: 1.13, 1.14 & ... Apr 24, 2018
@folsen
Copy link
Contributor

folsen commented May 20, 2018

A month later it is still not 1.0, I think we should consider it for new code, but closing this issue until it is in a more stable place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F8-enhancement 🎊 An additional feature request. M4-core ⛓ Core client code / Rust. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

No branches or pull requests

5 participants