update exception handler with AuthenticationException

This commit is contained in:
Joseph Silber 2016-05-22 15:00:11 -04:00
parent 6dfc0229b2
commit b069ff0d0c
1 changed files with 14 additions and 0 deletions

View File

@ -3,6 +3,7 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
@ -17,12 +18,25 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
AuthenticationException::class,
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $e
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function unauthenticated($request, AuthenticationException $e)
{
parent::unauthenticated($request, $e);
}
/**
* Report or log an exception.
*