+.. type:: json_error_t
+
+ This data structure is used to return information on decoding
+ errors from the decoding functions.
+
+ .. member:: const char *text
+
+ The error message (in UTF-8), or an empty string if a message is
+ not available. This is actually a fixed-length character array,
+ but should be considered constant.
+
+ .. member:: int line
+
+ The line number on which the error occurred, or -1 if this
+ information is not available.
+
+ The normal use of :type:`json_error_t` is to allocate it on the
+ stack, and pass a pointer to a decoding function. Example::
+
+ int main() {
+ json_t *json;
+ json_error_t error;
+
+ json = json_load_file("/path/to/file.json", 0, &error);
+ if(!json) {
+ /* the error variable contains error information */
+ }
+ ...
+ }
+
+ Also note that if the decoding succeeded (``json != NULL`` in the
+ above example), the contents of ``error`` are unspecified.
+
+ All decoding functions also accept *NULL* as the
+ :type:`json_error_t` pointer, in which case no error information
+ is returned to the caller.
+