Clean up exception handler. Add new ignores.

This commit is contained in:
Taylor Otwell 2015-10-14 08:46:25 -05:00
parent 5b08ff0b34
commit 37363acacd
1 changed files with 4 additions and 4 deletions

View File

@ -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 @@ public function report(Exception $e)
*/
public function render($request, Exception $e)
{
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
return parent::render($request, $e);
}
}