generated from liutk/owl-admin-base
NotFoundHttpException
parent
3c52fb0f60
commit
7abf180f3b
|
|
@ -4,9 +4,10 @@ namespace App\Exceptions;
|
||||||
|
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
use Illuminate\Http\{Request};
|
use Illuminate\Http\{Request, Response};
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Slowlyo\OwlAdmin\Exceptions\AdminException;
|
use Slowlyo\OwlAdmin\Exceptions\AdminException;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
|
|
@ -34,6 +35,10 @@ class Handler extends ExceptionHandler
|
||||||
$this->renderable(function (RuntimeException $e, Request $request) {
|
$this->renderable(function (RuntimeException $e, Request $request) {
|
||||||
return response(['code' => $e->getCode(), 'message' => $e->getMessage()], $e->getHttpStatusCode());
|
return response(['code' => $e->getCode(), 'message' => $e->getMessage()], $e->getHttpStatusCode());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->renderable(function (NotFoundHttpException $e, Request $request) {
|
||||||
|
return response(['code' => Response::HTTP_NOT_FOUND, 'message' => $e->getMessage()], Response::HTTP_NOT_FOUND);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function invalidJson($request, ValidationException $exception)
|
protected function invalidJson($request, ValidationException $exception)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue