Skip to content

Commit

Permalink
json-parser: When parsing fails, tag the error with the input
Browse files Browse the repository at this point in the history
When JSON parsing fails with returning a NULL object, add the original
input to the emitted error message, for easier debugging.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
  • Loading branch information
algernon committed Jul 24, 2013
1 parent 8ca9d92 commit 992253b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/json/jsonparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ log_json_parser_process (LogParser *s, LogMessage **pmsg, const LogPathOptions *

if (!jso)
{
msg_error ("Unparsable JSON stream encountered", NULL);
msg_error ("Unparsable JSON stream encountered",
evt_tag_str ("input", input),
NULL);
return FALSE;
}
if (!json_object_is_type (jso, json_type_object))
Expand Down

0 comments on commit 992253b

Please sign in to comment.