JSON decoder error codes
#include <sys/json.h>
typedef enum { JSON_DECODER_OK = 0, JSON_DECODER_NO_MEMORY = 1, JSON_DECODER_BAD_TYPE = 2, JSON_DECODER_NOT_FOUND = 3, JSON_DECODER_PARSE_ERROR = 4, JSON_DECODER_CONVERSION_FAILED = 5, JSON_DECODER_POP_AT_ROOT = 6, JSON_DECODER_INVALID_STATE = 7, JSON_DECODER_EXTERNAL_ERROR = 8, JSON_DECODER_ENCODING_ERROR = 9, JSON_DECODER_FILE_READ_ERROR = 10 } json_decoder_error_t;
No error condition exists.
The operation failed to allocate memory.
The requested data doesn't match the data type of the element or property.
The requested element or property was not found.
An error occurred parsing JSON data.
A numeric conversion failed because the result would lose precision or be out of range.
A call to json_decoder_pop() was made while at the root of the decoder tree.
A call to json_decoder_set_state() was made with an invalid state instance.
An external error has occurred. This is not used internally but may be set via json_decoder_set_status() to signal a caller-detected error.
An error occurred when using an encoder from json_decoder_get_encoder() to add or modify data in the decoder tree.
An error occurred reading JSON data from a file. The specific error is indicated by errno.
JSON decoder error codes are returned with each json_decoder_*() function call, and are also available with json_decoder_get_status().