Skip to content

fromjson not returning error on parse failure #4

Open
@tredmon

Description

@tredmon

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions