mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
When reporting an error to the user, add information about the offending object/value (possibly truncated). The goal is to give a user some context regarding which input object caused the runtime error. Examples: $ echo '"hello"' | ./jq '-.' jq: error: string ("hello") cannot be negated $ echo '"very-long-string"' | ./jq '-.' jq: error: string ("very-long-...) cannot be negated $ echo '["1",2]' | ./jq '.|join(",")' jq: error: string (",") and number (2) cannot be added $ echo '["1","2",{"a":{"b":{"c":33}}}]' | ./jq '.|join(",")' jq: error: string (",") and object ({"a":{"b":{...) cannot be added $ echo '{"a":{"b":{"c":33}}}' | ./jq '.a | @tsv' jq: error: object ({"b":{"c":33}}) cannot be tsv-formatted, only array (Fix #754)