Skip to content

Commit

Permalink
adaptived: enhance json config file error handling
Browse files Browse the repository at this point in the history
Run the error enum returned by json_tokener_parse_verbose()
through json_tokener_error_desc() for a string with a human
readable description of the error.

Signed-off-by: George Kennedy <[email protected]>
  • Loading branch information
gkennedy12 committed Nov 15, 2024
1 parent fdabb01 commit 28efb9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adaptived/src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ static int parse_json(struct adaptived_ctx * const ctx, const char * const buf)

obj = json_tokener_parse_verbose(buf, &err);
if (!obj || err) {
if (err)
adaptived_err("%s: %s\n", __func__, json_tokener_error_desc(err));
ret = -EINVAL;
goto out;
}
Expand Down

0 comments on commit 28efb9f

Please sign in to comment.