Handler.php 1.2 KB

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