Skip to content

Commit

Permalink
move exceptions into internal array
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 6, 2017

Unverified

This user has not yet uploaded their public signing key.
1 parent 7b0095a commit 841b36c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -41,6 +41,21 @@ class Handler implements ExceptionHandlerContract
*/
protected $dontReport = [];

/**
* A list of the internal exception types that should not be reported.
*
* @var array
*/
protected $internalDontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
HttpResponseException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
];

/**
* Create a new exception handler instance.
*
@@ -98,7 +113,7 @@ public function shouldReport(Exception $e)
*/
protected function shouldntReport(Exception $e)
{
$dontReport = array_merge($this->dontReport, [HttpResponseException::class]);
$dontReport = array_merge($this->dontReport, $this->internalDontReport);

return ! is_null(collect($dontReport)->first(function ($type) use ($e) {
return $e instanceof $type;

0 comments on commit 841b36c

Please sign in to comment.