lodfe/app/Exceptions/Handler.php

51 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2020-01-19 21:24:54 +09:00
<?php
namespace App\Exceptions;
2021-11-22 03:14:24 +09:00
use Throwable;
2020-01-19 21:24:54 +09:00
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Validation\ValidationException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
2021-11-22 03:14:24 +09:00
* @param \Throwable $exception
2020-01-19 21:24:54 +09:00
* @return void
*/
2021-11-22 03:14:24 +09:00
public function report(Throwable $exception)
2020-01-19 21:24:54 +09:00
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
2021-11-22 03:14:24 +09:00
* @param \Throwable $exception
2020-01-19 21:24:54 +09:00
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
2021-11-22 03:14:24 +09:00
public function render($request, Throwable $exception)
2020-01-19 21:24:54 +09:00
{
return parent::render($request, $exception);
}
}