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
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: