From 37363acacd72fa2bdd043af66be085944476def9 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 14 Oct 2015 08:46:25 -0500 Subject: [PATCH] Clean up exception handler. Add new ignores. --- app/Exceptions/Handler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 799152f3..4e4ebf67 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,8 +3,10 @@ namespace App\Exceptions; use Exception; +use Illuminate\Auth\Access\UnauthorizedException; use Illuminate\Database\Eloquent\ModelNotFoundException; use Symfony\Component\HttpKernel\Exception\HttpException; +use Illuminate\Foundation\Validation\ValidationException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; @@ -18,6 +20,8 @@ class Handler extends ExceptionHandler protected $dontReport = [ HttpException::class, ModelNotFoundException::class, + UnauthorizedException::class, + ValidationException::class, ]; /** @@ -42,10 +46,6 @@ class Handler extends ExceptionHandler */ public function render($request, Exception $e) { - if ($e instanceof ModelNotFoundException) { - $e = new NotFoundHttpException($e->getMessage(), $e); - } - return parent::render($request, $e); } }