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

Errors Don't Implement Sync Trait #30

Closed
tonygrue opened this issue Dec 13, 2018 · 2 comments
Closed

Errors Don't Implement Sync Trait #30

tonygrue opened this issue Dec 13, 2018 · 2 comments

Comments

@tonygrue
Copy link

(I'm using Rust for the first time, so apologies if this is known or intentional or a useless bug. Don't be afraid to tell me if I'm just doing it wrong.)

I'm implementing a web app with hyper and my returns are a Stream. i.e. Body::wrap_stream(GenerateStreamForResponse::new());

One thing my GenerateStreamForResponse does is use mysql_async and along the way that can generate an error. Body::wrap_stream however requires errors generated by the stream passed to it implement the Sync trait. I see from the docs, that mysql_async errors do not impl Sync (https://docs.rs/mysql_async/0.15.1/mysql_async/errors/struct.Error.html). Looking at the impl it looks like error_chain! is used, and looking at error_chain's issue tracker, it looks like this is known, and maybe intentional, but causing problems for users (rust-lang-deprecated/error-chain#240).

Perhaps I should just be translating these errors anyway, but it also looks like some other people are moving away from error_chain. Should mysql_async move away from error_chain, should mysql_async add it's voice to request error_chain support Sync, or should I just translate my error?

One thing I can say for certain, is this is one of a million paper cuts I've hit as a new rust user.

@blackbeam
Copy link
Owner

Hi!
Yeah. Move to Failure is scheduled but you should translate errors until then.

@blackbeam
Copy link
Owner

Fixed in v0.17.0

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