Files
spa-api/app/Exceptions/Handler.php

52 lines
1.3 KiB
PHP
Raw Normal View History

<?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;
use Illuminate\Database\Eloquent\ModelNotFoundException;
2015-06-15 22:22:23 +01:00
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
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,
ModelNotFoundException::class,
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.
*
* @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
* @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
}