mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-08-10 00:11:38 +08:00
完善异常处理逻辑
This commit is contained in:
parent
93279a53e2
commit
febf7d9982
@ -127,6 +127,13 @@ class HttpErrorHandler extends Injectable
|
|||||||
{
|
{
|
||||||
$errors = require config_path('errors.php');
|
$errors = require config_path('errors.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向外隐藏具体的500异常信息
|
||||||
|
*/
|
||||||
|
if ($this->response->getStatusCode() == 500) {
|
||||||
|
$code = 'sys.internal_server_error';
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'code' => $code,
|
'code' => $code,
|
||||||
'msg' => $errors[$code] ?? $code,
|
'msg' => $errors[$code] ?? $code,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user