$e->getFile(), 'line' => $e->getLine(), 'trace' => $e->getTrace(), 'previous' => $e->getPrevious(), ] : []; // 添加自定义异常处理机制 if ($e instanceof DbException) { return app('json')->fail('数据获取失败', $massageData); } elseif ($e instanceof AuthException || $e instanceof ValidateException || $e instanceof UtilException) { return app('json')->make($e->getCode() ?: 400, $e->getMessage()); } elseif ($e instanceof AdminException) { return app('json')->fail($e->getMessage(), $massageData); } else { return app('json')->code(200)->make(400, $e->getMessage(), $massageData); } } }