Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove failure #442

Closed
datanel opened this issue Oct 31, 2019 · 3 comments
Closed

Remove failure #442

datanel opened this issue Oct 31, 2019 · 3 comments

Comments

@datanel
Copy link
Member

datanel commented Oct 31, 2019

Should we consider removing failure and having custom errors implementing https://doc.rust-lang.org/std/error/trait.Error.html ?

failure wraps errors implementing https://docs.rs/failure/0.1.6/failure/trait.Fail.html not https://doc.rust-lang.org/std/error/trait.Error.html

what we might do

@woshilapin
Copy link
Contributor

Sounds like a good idea. It'd be nice to experiment before taking a decision but I can see some limitations with the solution with have today (failure). Therefore, I'm curious about what you propose. Let's see if the situation would be better (I believe it would from what I read).

@woshilapin
Copy link
Contributor

From this survey on error-handlers in Rust, it looks like anyhow is a serious solution to replace failure. One missing feature of anyhow is backtraces (but this should be soon solved since backtraces are part of Rust nightly and anyhow uses them). And thiserror seems like a very good candidate for structured errors.

These are great articles on the topic.

I was planning on experimenting anyhow with thiserror in the near future, for example, converting one of our API fully to this new pattern (I was thinking of transit_model::hellogo_fares::enrich_with_hellogo_fares). Any objection?

@datanel
Copy link
Member Author

datanel commented Jan 26, 2023

failure was replaced by anyhow #829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants