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

Open
svartalf opened this Issue May 25, 2018 · 3 comments

Comments

2 participants
@svartalf

svartalf commented May 25, 2018

Related to rust-lang-nursery/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

This comment has been minimized.

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

This comment has been minimized.

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 referenced this issue Sep 6, 2018

Open

v1 release #331

5 of 14 tasks complete

@Keats Keats added the help wanted label Sep 21, 2018

@Keats

This comment has been minimized.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment