-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
error
ignores null input
#2231
Comments
The behavior was changed by the following two commits before 1.5.
% ./jq-1.4 -n 'error(null)'
jq: error: null
% ./jq-1.5 -n 'error(null)'
This seems to behave like % ./jq-1.4 -n '[1,error(null),2]'
jq: error: null
[
1,
2
]
% ./jq-1.5 -n '[1,error(null),2]'
[
1,
2
] I am not sure we can change the behavior from now whether it is intended or not. |
This works on my side. Perhaps putting the |
This issue is about the input is |
Do you mean we can't change it because of backwards compatibility? I.e. someone might be relying on this behavior of
@nicowilliams did you intend to change this behavior in above commits? Do you think this should be fixed or maybe just documented? |
This is an expected behavior of |
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#2169, close jqlang#1148) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036) - Add non-string examples of index/1, rindex/1 (close jqlang#1422)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#2169, close jqlang#1148) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036) - Add non-string examples of index/1, rindex/1 (close jqlang#1422)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#2169, close jqlang#1148) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036) - Add non-string examples of index/1, rindex/1 (close jqlang#1422)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036) - Add non-string examples of index/1, rindex/1 (close jqlang#1422)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
- Add error/0 and mentions null input behavior (close jqlang#2231) - Explain value iterator suffix syntax .foo[] (close jqlang#1047) - Mention array slicing is also zero-based (close jqlang#2094) - Add examples of input and inputs filters (close jqlang#2216, close jqlang#2470) - Improve sort_by about multiple values (close jqlang#2103, close jqlang#2467, close jqlang#2474) - Improve foreach section and simplify examples (close jqlang#1148, close jqlang#2169) - Fix recurse/1 document on how it is identical using recurse/2 (close jqlang#2036, close jqlang#2412) - Add non-string examples of index/1, rindex/1 (close jqlang#1422) - Simplify the example of truncate_stream/1 (close jqlang#1736)
…c.) (#2744) - Add error/0 and mentions null input behavior (close #2231) - Explain value iterator suffix syntax .foo[] (close #1047) - Mention array slicing is also zero-based (close #2094) - Add examples of input and inputs filters (close #2216, close #2470) - Improve sort_by about multiple values (close #2103, close #2467, close #2474) - Improve foreach section and simplify examples (close #1148, close #2169) - Fix recurse/1 document on how it is identical using recurse/2 (close #2036, close #2412) - Add non-string examples of index/1, rindex/1 (close #1422) - Simplify the example of truncate_stream/1 (close #1736)
The change to |
#2823 changed the behavior to throw an error this case. |
Describe the bug
Both
error/0
anderror/1
do nothing fornull
(not empty!) inputTo Reproduce
Expected behavior
Errors should never be ignored, should write stderr message and cause non-zero exit code
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: