json_decoder_get_status()

Get the error status of the JSON decoder

Synopsis:

#include <sys/json.h>
json_decoder_error_t json_decoder_get_status(json_decoder_t *decoder,
                                             bool clear);

Arguments:

decoder
The JSON decoder instance.
clear
Pass true to clear the error status following the call.

Library:

libjson

Description:

Any attempt to extract data from or push data into objects that results in an error sets the decoder to an error status. Rather than checking return codes after every operation, callers can perform a series of operations and check if the entire set was completed successfully, by calling json_decoder_get_status().

Returns:

The current error status of the decoder (see json_decoder_error_t).