enhanced json error handling
This commit is contained in:
parent
af9aad6aae
commit
c42427d6ed
@ -182,6 +182,11 @@ static int invoke_data_inst (mio_json_t* json, mio_json_inst_t inst)
|
||||
|
||||
if (inst != MIO_JSON_INST_STRING && inst != __INST_WORD_STRING)
|
||||
{
|
||||
if (inst == MIO_JSON_INST_END_ARRAY)
|
||||
mio_seterrbfmt (json->mio, MIO_EINVAL, "object key not a string - <array>");
|
||||
else if (inst == MIO_JSON_INST_END_OBJECT)
|
||||
mio_seterrbfmt (json->mio, MIO_EINVAL, "object key not a string - <object>");
|
||||
else
|
||||
mio_seterrbfmt (json->mio, MIO_EINVAL, "object key not a string - %.*js", json->tok.len, json->tok.ptr);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user