Json 에러시 에러 표기하도록

This commit is contained in:
2018-06-29 00:30:05 +09:00
parent bcb8696384
commit 27f36ca508
+6 -6
View File
@@ -65,22 +65,22 @@ class WebUtil
//Use a switch statement to figure out the exact error. //Use a switch statement to figure out the exact error.
switch ($jsonError) { switch ($jsonError) {
case JSON_ERROR_DEPTH: case JSON_ERROR_DEPTH:
$error .= 'Maximum depth exceeded!'; $error .= 'Maximum depth exceeded! : '.$content;
break; break;
case JSON_ERROR_STATE_MISMATCH: case JSON_ERROR_STATE_MISMATCH:
$error .= 'Underflow or the modes mismatch!'; $error .= 'Underflow or the modes mismatch! : '.$content;
break; break;
case JSON_ERROR_CTRL_CHAR: case JSON_ERROR_CTRL_CHAR:
$error .= 'Unexpected control character found'; $error .= 'Unexpected control character found : '.$content;
break; break;
case JSON_ERROR_SYNTAX: case JSON_ERROR_SYNTAX:
$error .= 'Malformed JSON'; $error .= 'Malformed JSON : '.$content;
break; break;
case JSON_ERROR_UTF8: case JSON_ERROR_UTF8:
$error .= 'Malformed UTF-8 characters found!'; $error .= 'Malformed UTF-8 characters found! : '.$content;
break; break;
default: default:
$error .= 'Unknown error!'; $error .= 'Unknown error! : '.$content;
break; break;
} }
throw new \Exception($error); throw new \Exception($error);