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 <george.kennedy@oracle.com>
Acked-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
  • Loading branch information
gkennedy12 authored and drakenclimber committed Dec 5, 2024
1 parent 5df88d6 commit 5cc9c5f
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 5cc9c5f

Please sign in to comment.