onelson / jq-rs

Rust crate to provide programmatic access to `jq`.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement Send for jq_rs::Error

dcsobral opened this issue · comments

I'd like to use jq_rs together with error_chain, but it requires error types to implement std::error::Error + Send + 'static to work seamlessly.

Ah, cool. Thanks for reporting. I'll see what I can do to make this happen.

@dcsobral Does this sufficiently demonstrate the use case?

https://github.com/onelson/jq-rs/blob/error-chain-support/tests/error-chain-compat.rs

I haven't used error-chain before, but I'm assuming since this is compiling okay, it should be good to go.

@dcsobral Does this sufficiently demonstrate the use case?

https://github.com/onelson/jq-rs/blob/error-chain-support/tests/error-chain-compat.rs

I'm not sure. It looks right to me, but I'm too much of a newbie on Rust to be sure. What I do know is that I get failures to compile if I do this:

jq_rs::run(".", "[[[{}}").chain_err(|| "jq error")

Okay. I'll add a call to .chain_err() to the integration test. Thanks.

Once again, thanks for reporting. The fix is in for master @ 1f30a1c.

You can pin to this if you are in a rush, otherwise I'm looking at getting the next release cut sometime in the next week or so. I have a couple other things I'd like to address before then.