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

Make rafy::Error usable with error-chain #6

Open
alatiera opened this issue Sep 10, 2017 · 1 comment
Open

Make rafy::Error usable with error-chain #6

alatiera opened this issue Sep 10, 2017 · 1 comment

Comments

@alatiera
Copy link
Contributor

alatiera commented Sep 10, 2017

I think error-chain needs the Error to impl std::marker::Send, Not sure though.
Here is a compiler compain trying to add rafy::Error to error-chain:

error[E0277]: the trait bound `std::error::Error + 'static: std::marker::Send` is not satisfied           
  --> src/lib.rs:25:5     
   |                      
25 | /     error_chain! { 
26 | |         foreign_links {                       
27 | |             RafError(rafy::Error);            
28 | |             ReqError(reqwest::Error);         
...  |                    
31 | |         }          
32 | |     }              
   | |_____^ `std::error::Error + 'static` cannot be sent between threads safely                          
   |                      
   = help: the trait `std::marker::Send` is not implemented for `std::error::Error + 'static`             
   = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<std::error::Error + 'static>`
   = note: required because it appears within the type `std::boxed::Box<std::error::Error + 'static>`     
   = note: required because it appears within the type `rafy::Error`                                      
   = note: required because it appears within the type `errors::ErrorKind`                                
   = note: required because it appears within the type `errors::Error`                                    
   = note: this error originates in a macro outside of the current crate                   
@alatiera alatiera changed the title Make rafy::Error usable with ? and error-chain Make rafy::Error usable with error-chain Sep 10, 2017
@alatiera
Copy link
Contributor Author

Turns out compiler is complaining about ? cause it couldnt find the Error type at the Erro-chain thing.
And ? can be used with rafy!

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

1 participant