2015-06-01 15:43:37 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Exceptions;
|
2014-11-18 22:48:38 -06:00
|
|
|
|
|
|
|
|
use Exception;
|
2015-10-14 09:09:56 -05:00
|
|
|
use Illuminate\Auth\Access\AuthorizationException;
|
2015-08-06 12:07:04 -05:00
|
|
|
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
2015-06-15 22:22:23 +01:00
|
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
2015-10-14 08:46:25 -05:00
|
|
|
use Illuminate\Foundation\Validation\ValidationException;
|
2014-11-18 22:48:38 -06:00
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|
|
|
|
|
2015-02-22 20:47:03 -06:00
|
|
|
class Handler extends ExceptionHandler
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* A list of the exception types that should not be reported.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $dontReport = [
|
2015-10-14 09:09:56 -05:00
|
|
|
AuthorizationException::class,
|
2015-10-14 09:34:10 -05:00
|
|
|
HttpException::class,
|
2015-08-06 12:07:04 -05:00
|
|
|
ModelNotFoundException::class,
|
2015-10-14 08:46:25 -05:00
|
|
|
ValidationException::class,
|
2015-02-22 20:47:03 -06:00
|
|
|
];
|
2014-12-02 17:21:16 -06:00
|
|
|
|
2015-02-22 20:47:03 -06:00
|
|
|
/**
|
|
|
|
|
* Report or log an exception.
|
|
|
|
|
*
|
|
|
|
|
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
|
|
|
|
*
|
2015-10-30 18:54:41 +00:00
|
|
|
* @param \Exception $e
|
2015-02-22 20:47:03 -06:00
|
|
|
* @return void
|
|
|
|
|
*/
|
2015-08-06 12:49:41 -05:00
|
|
|
public function report(Exception $e)
|
2015-02-22 20:47:03 -06:00
|
|
|
{
|
|
|
|
|
return parent::report($e);
|
|
|
|
|
}
|
2014-11-18 22:48:38 -06:00
|
|
|
|
2015-02-22 20:47:03 -06:00
|
|
|
/**
|
|
|
|
|
* Render an exception into an HTTP response.
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Http\Request $request
|
2015-10-30 18:54:41 +00:00
|
|
|
* @param \Exception $e
|
2015-02-22 20:47:03 -06:00
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
|
*/
|
2015-08-06 12:49:41 -05:00
|
|
|
public function render($request, Exception $e)
|
2015-02-22 20:47:03 -06:00
|
|
|
{
|
|
|
|
|
return parent::render($request, $e);
|
|
|
|
|
}
|
2014-11-18 22:48:38 -06:00
|
|
|
}
|