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

fromjson not returning error on parse failure #4

Open
tredmon opened this issue May 18, 2024 · 0 comments
Open

fromjson not returning error on parse failure #4

tredmon opened this issue May 18, 2024 · 0 comments

Comments

@tredmon
Copy link

tredmon commented May 18, 2024

When j9::run encounters an error in the input it should result in an error, but it currently fails silently.

Example:

let s = j9::run(".a=(.a|fromjson)", "{\"a\":\"4v2\"}").expect("Should have failed at parsing");
panic!("incorrectly returned success : {s:?}");

prints

incorrectly returned success : []

but

jq -n '{a:"4v2"}' | jq '.a=(.a|fromjson)'

prints

jq: error (at :3): Invalid numeric literal at EOF at line 1, column 3 (while parsing '4v2')

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