perf: 无环境变量不使用异常模版

This commit is contained in:
Ying
2022-08-20 21:03:39 +08:00
parent 7345c52212
commit f6b2eeae15

View File

@@ -52,6 +52,9 @@ class ExceptionHandle extends \Webman\Exception\ExceptionHandler
public function render(Request $request, Throwable $exception): Response
{
if (!file_exists(root_path(). '.env')) {
return parent::render($request, $exception);
}
return getenv('APP_DEBUG') ? parent::render($request, $exception) : view(config('app.exception_tpl'), ['trace' => $exception]);
}
}