Handler.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Exceptions;
  3. use Exception;
  4. use Illuminate\Session\TokenMismatchException;
  5. use Illuminate\Validation\ValidationException;
  6. use Illuminate\Auth\Access\AuthorizationException;
  7. use Illuminate\Database\Eloquent\ModelNotFoundException;
  8. use Symfony\Component\HttpKernel\Exception\HttpException;
  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. TokenMismatchException::class,
  22. ValidationException::class,
  23. ];
  24. /**
  25. * Report or log an exception.
  26. *
  27. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
  28. *
  29. * @param \Exception $e
  30. * @return void
  31. */
  32. public function report(Exception $e)
  33. {
  34. parent::report($e);
  35. }
  36. /**
  37. * Render an exception into an HTTP response.
  38. *
  39. * @param \Illuminate\Http\Request $request
  40. * @param \Exception $e
  41. * @return \Illuminate\Http\Response
  42. */
  43. public function render($request, Exception $e)
  44. {
  45. return parent::render($request, $e);
  46. }
  47. }