Add try EXP catch EXP
This commit is contained in:
1 parent
9113282c27
commit
7fce34292e
9 files changed
+108
-15
No files matched your search
@@ -124,6 +124,12 @@ static int process(jq_state *jq, jv value, int flags) {
|
||||
if (options & UNBUFFERED_OUTPUT)
|
||||
fflush(stdout);
|
||||
}
|
||||
if (jv_invalid_has_msg(jv_copy(result))) {
|
||||
// Uncaught jq exception
|
||||
jv msg = jv_invalid_get_msg(jv_copy(result));
|
||||
fprintf(stderr, "jq: error: %s\n", jv_string_value(msg));
|
||||
jv_free(msg);
|
||||
}
|
||||
jv_free(result);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user