isIgnoreReport($exception)) { \app\utils\Logger::error(\app\utils\Logger::CAT_ERROR, $exception->getMessage(), [ 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'trace' => substr($exception->getTraceAsString(), 0, 2000), ]); } parent::report($exception); } /** * Render an exception into an HTTP response. * * @access public * @param \think\Request $request * @param Throwable $e * @return Response */ public function render($request, Throwable $e): Response { // 添加自定义异常处理机制 // 其他错误交给系统处理 return parent::render($request, $e); } }