Handler.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
  8. use Symfony\Component\HttpKernel\Exception\HttpException;
  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. }