not found exception add log

This commit is contained in:
xiaomlove
2023-06-11 14:56:22 +08:00
parent 8e156dcbea
commit 3ffc6aaa36
2 changed files with 3 additions and 2 deletions

View File

@@ -71,7 +71,8 @@ class Handler extends ExceptionHandler
$this->renderable(function (NotFoundHttpException $e) {
if ($e->getPrevious() && $e->getPrevious() instanceof ModelNotFoundException) {
$exception = $e->getPrevious();
return response()->json(fail($exception->getMessage(), request()->all()), 404);
do_log(sprintf("NotFoundHttpException: %s, trace: %s", $exception->getMessage(), $exception->getTraceAsString()), 'error');
return response()->json(fail($exception->getMessage(), request()->all()));
}
});
}