Commit 37363aca authored by Taylor Otwell's avatar Taylor Otwell

Clean up exception handler. Add new ignores.

parent 5b08ff0b
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception; use Exception;
use Illuminate\Auth\Access\UnauthorizedException;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
...@@ -18,6 +20,8 @@ class Handler extends ExceptionHandler ...@@ -18,6 +20,8 @@ class Handler extends ExceptionHandler
protected $dontReport = [ protected $dontReport = [
HttpException::class, HttpException::class,
ModelNotFoundException::class, ModelNotFoundException::class,
UnauthorizedException::class,
ValidationException::class,
]; ];
/** /**
...@@ -42,10 +46,6 @@ class Handler extends ExceptionHandler ...@@ -42,10 +46,6 @@ class Handler extends ExceptionHandler
*/ */
public function render($request, Exception $e) public function render($request, Exception $e)
{ {
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
return parent::render($request, $e); return parent::render($request, $e);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment