json decoding errors shouldnt' be fatal
This commit is contained in:
parent
d658479048
commit
4c5a88a822
|
@ -2100,15 +2100,20 @@ function checkJsonError($value) {
|
|||
$value = var_export($value, true);
|
||||
switch ( json_last_error() ) {
|
||||
case JSON_ERROR_DEPTH :
|
||||
ZM\Fatal("Unable to decode JSON string '$value', maximum stack depth exceeded");
|
||||
ZM\Error("Unable to decode JSON string '$value', maximum stack depth exceeded");
|
||||
break;
|
||||
case JSON_ERROR_CTRL_CHAR :
|
||||
ZM\Fatal("Unable to decode JSON string '$value', unexpected control character found");
|
||||
ZM\Error("Unable to decode JSON string '$value', unexpected control character found");
|
||||
break;
|
||||
case JSON_ERROR_STATE_MISMATCH :
|
||||
ZM\Fatal("Unable to decode JSON string '$value', invalid or malformed JSON");
|
||||
ZM\Error("Unable to decode JSON string '$value', invalid or malformed JSON");
|
||||
break;
|
||||
case JSON_ERROR_SYNTAX :
|
||||
ZM\Fatal("Unable to decode JSON string '$value', syntax error");
|
||||
ZM\Error("Unable to decode JSON string '$value', syntax error");
|
||||
break;
|
||||
default :
|
||||
ZM\Fatal("Unable to decode JSON string '$value', unexpected error ".json_last_error());
|
||||
ZM\Error("Unable to decode JSON string '$value', unexpected error ".json_last_error());
|
||||
break;
|
||||
case JSON_ERROR_NONE:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue