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

Consider remove error_chain dependency #297

Closed
svartalf opened this issue May 25, 2018 · 3 comments
Closed

Consider remove error_chain dependency #297

svartalf opened this issue May 25, 2018 · 3 comments

Comments

@svartalf
Copy link

Related to rust-lang-deprecated/error-chain#240, tera::Error instances are !Sync.

For example, it is impossible to return tera::Error directly from the actix-web handler, and it is easier just to suppress it: https://github.com/actix/examples/blob/master/template_tera/src/main.rs#L28

Since tera::Error is quite simple, it might be worth to replace error_chain! call with a plain enum or use the failure crate.

@Keats
Copy link
Owner

Keats commented May 28, 2018

That's a breaking change so for the next major version.

Related recent discussion: https://www.reddit.com/r/rust/comments/8lt8k6/do_i_really_need_failureerrorchain/

Failure seems nice but not really actively maintained so maybe going the plain enum would be better, depending on the timeline for the next major version

@Keats
Copy link
Owner

Keats commented Aug 1, 2018

Looks like some of Failure is coming to Std so it would be better to wait before making a breaking change: https://www.reddit.com/r/rust/comments/92kozl/feedback_needed_upcoming_failure_012_release/e36pf5w/?context=0

@Keats Keats mentioned this issue Sep 6, 2018
16 tasks
@Keats
Copy link
Owner

Keats commented Nov 6, 2018

So the way to go is probably plain std Error enum since using failure would probably be a dead end as things get moved to std. I am not sure how to provide the same UX as with error-chain though where errors are chained pretty seamlessly to give the whole context.

Once we have it working, we can also add more error types like the ones from #322

@Keats Keats removed the help wanted label Nov 10, 2018
@Keats Keats added the done label Jan 4, 2019
@Keats Keats closed this as completed Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants