diff --git a/web/includes/functions.php b/web/includes/functions.php index 59cb169d7..3bc47c490 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2075,18 +2075,23 @@ function isVector(&$array) { function checkJsonError($value) { if ( function_exists('json_last_error') ) { - $value = var_export($value,true); - switch( json_last_error() ) { + $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; }