2016-01-08 09:02:15 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FireflyIII\Exceptions;
|
2015-02-05 21:39:52 -06:00
|
|
|
|
|
|
|
use Exception;
|
2016-01-08 09:02:15 -06:00
|
|
|
use Illuminate\Auth\Access\AuthorizationException;
|
|
|
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
2015-05-26 15:12:34 -05:00
|
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
2016-01-08 09:02:15 -06:00
|
|
|
use Illuminate\Foundation\Validation\ValidationException;
|
|
|
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
2015-02-05 21:39:52 -06:00
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
class Handler extends ExceptionHandler
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* A list of the exception types that should not be reported.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2016-01-08 09:02:15 -06:00
|
|
|
protected $dontReport = [
|
|
|
|
AuthorizationException::class,
|
|
|
|
HttpException::class,
|
|
|
|
ModelNotFoundException::class,
|
|
|
|
ValidationException::class,
|
|
|
|
];
|
2015-02-05 21:39:52 -06:00
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
2016-01-08 09:02:15 -06:00
|
|
|
* Report or log an exception.
|
2015-02-11 00:35:10 -06:00
|
|
|
*
|
2016-01-08 09:02:15 -06:00
|
|
|
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
2015-02-11 00:35:10 -06:00
|
|
|
*
|
2016-01-08 09:02:15 -06:00
|
|
|
* @param \Exception $e
|
|
|
|
* @return void
|
2015-02-11 00:35:10 -06:00
|
|
|
*/
|
2016-01-08 09:02:15 -06:00
|
|
|
public function report(Exception $e)
|
2015-02-11 00:35:10 -06:00
|
|
|
{
|
2016-01-08 09:02:15 -06:00
|
|
|
return parent::report($e);
|
2015-02-11 00:35:10 -06:00
|
|
|
}
|
2015-02-05 21:39:52 -06:00
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
2016-01-08 09:02:15 -06:00
|
|
|
* Render an exception into an HTTP response.
|
2015-02-11 00:35:10 -06:00
|
|
|
*
|
2016-01-08 09:02:15 -06:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param \Exception $e
|
|
|
|
* @return \Illuminate\Http\Response
|
2015-02-11 00:35:10 -06:00
|
|
|
*/
|
2016-01-08 09:02:15 -06:00
|
|
|
public function render($request, Exception $e)
|
2015-02-11 00:35:10 -06:00
|
|
|
{
|
2016-01-08 09:02:15 -06:00
|
|
|
return parent::render($request, $e);
|
2015-02-11 00:35:10 -06:00
|
|
|
}
|
2015-02-05 21:39:52 -06:00
|
|
|
}
|