3 namespace App\Exceptions;
6 use Illuminate\Validation\ValidationException;
7 use Illuminate\Auth\Access\AuthorizationException;
8 use Illuminate\Database\Eloquent\ModelNotFoundException;
9 use Symfony\Component\HttpKernel\Exception\HttpException;
10 use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
12 class Handler extends ExceptionHandler
15 * A list of the exception types that should not be reported.
19 protected $dontReport = [
20 AuthorizationException::class,
22 ModelNotFoundException::class,
23 ValidationException::class,
27 * Report or log an exception.
29 * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
31 * @param \Exception $e
34 public function report(Exception $e)
40 * Render an exception into an HTTP response.
42 * @param \Illuminate\Http\Request $request
43 * @param \Exception $e
44 * @return \Illuminate\Http\Response
46 public function render($request, Exception $e)
48 if ($e instanceof HttpException) {
49 return view('errors/404');
52 return parent::render($request, $e);