抛错信息整理

This commit is contained in:
吴昊天 2023-03-20 17:39:32 +08:00
parent 89587edd55
commit 618f56d1fc
4 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ class AdminApiExceptionHandle extends Handle
'trace' => $e->getTrace(),
'previous' => $e->getPrevious(),
] : [];
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
$message = $e->getMessage();
// 添加自定义异常处理机制
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
return app('json')->make($e->getCode() ?: 400, $message, $massageData);

View File

@ -85,7 +85,7 @@ class ApiExceptionHandle extends Handle
'trace' => $e->getTrace(),
'previous' => $e->getPrevious(),
] : [];
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
$message = $e->getMessage();
// 添加自定义异常处理机制
if ($e instanceof ApiStatusException) {
return app('json')->status($e->getApiStatus(), $message, $e->getApiData());

View File

@ -84,7 +84,7 @@ class KefuApiExceptionHandle extends Handle
'trace' => $e->getTrace(),
'previous' => $e->getPrevious(),
] : [];
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
$message = $e->getMessage();
// 添加自定义异常处理机制
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
return app('json')->make($e->getCode() ?: 400, $message, $massageData);

View File

@ -84,7 +84,7 @@ class OutApiExceptionHandle extends Handle
'trace' => $e->getTrace(),
'previous' => $e->getPrevious(),
] : [];
$message = Env::get('app_debug', false) ? $e->getMessage() : '很抱歉,系统开小差了';
$message = $e->getMessage();
// 添加自定义异常处理机制
if ($e instanceof AuthException || $e instanceof AdminException || $e instanceof ApiException || $e instanceof ValidateException) {
return app('json')->make($e->getCode() ?: 400, $message, $massageData);