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

Making errors Sync #240

Open
withoutboats opened this Issue Nov 8, 2017 · 6 comments

Comments

Projects
None yet
6 participants
@withoutboats
Copy link

withoutboats commented Nov 8, 2017

The failure crate requires that errors are Sync. Currently (but not in all previous versions) error-chain makes errors which are !Sync (because they have a Box<Error + Send> inside them).

It would be beneficial IMO to:

  1. Provide a Sync adapter for errors. (This could be optimized to not actually use a Mutex except in the Box case, if you think its warranted).
  2. Release a breaking change which reverts back to requiring Sync by default. This is probably at least a little controversial.
@bvinc

This comment has been minimized.

Copy link

bvinc commented Nov 17, 2017

I believe I'm being hit by a problem of my errors being !Sync. I'm implementing Read and Write, so I'm trying to wrap my errors in an io::Error. This should be easy, but it's impossible if my error is !Sync, because io:Error requires it to be Sync.

@tazjin

This comment has been minimized.

Copy link

tazjin commented Mar 29, 2018

This would be beneficial for those that don't want to lose the type-safety of error-chain but have to interface with crates using failure!

@jnicholls

This comment has been minimized.

Copy link

jnicholls commented Apr 26, 2018

Agreed, wish there was at least an adapter out of the box. I'm having to translate my errors at the moment and it's a hassle :D

@rustonaut

This comment has been minimized.

Copy link

rustonaut commented May 31, 2018

I just run into this too it's quite a bumper and very depressing if it's
in a (opt) dependency and you have to have Sync errors because of
another dependency/software architecture/...

@jnicholls

This comment has been minimized.

Copy link

jnicholls commented May 31, 2018

@elichai

This comment has been minimized.

Copy link

elichai commented Dec 19, 2018

Any news about this?
This cause a lot of troubles if you use failure::Error but use a library that uses error-chain

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