Handler.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Exceptions;
  3. use Exception;
  4. use Illuminate\Auth\Access\AuthorizationException;
  5. use Illuminate\Database\Eloquent\ModelNotFoundException;
  6. use Symfony\Component\HttpKernel\Exception\HttpException;
  7. use Illuminate\Foundation\Validation\ValidationException;
  8. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  9. use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
  10. class Handler extends ExceptionHandler
  11. {
  12. /**
  13. * A list of the exception types that should not be reported.
  14. *
  15. * @var array
  16. */
  17. protected $dontReport = [
  18. AuthorizationException::class,
  19. HttpException::class,
  20. ModelNotFoundException::class,
  21. ValidationException::class,
  22. ];
  23. /**
  24. * Report or log an exception.
  25. *
  26. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  27. *
  28. * @param \Throwable $e
  29. * @return void
  30. */
  31. public function report(Exception $e)
  32. {
  33. return parent::report($e);
  34. }
  35. /**
  36. * Render an exception into an HTTP response.
  37. *
  38. * @param \Illuminate\Http\Request $request
  39. * @param \Throwable $e
  40. * @return \Illuminate\Http\Response
  41. */
  42. public function render($request, Exception $e)
  43. {
  44. return parent::render($request, $e);
  45. }
  46. }