diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 9d17fb099057..76b2087ad89e 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -4,7 +4,11 @@ use Redirect; use Utils; use Exception; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; -use Illuminate\Database\Eloquent\ModelNotFoundException; +use Illuminate\Http\Exception\HttpResponseException; +use Illuminate\Auth\Access\AuthorizationException; +use Illuminate\Database\Eloquent\ModelNotFoundException; +use Symfony\Component\HttpKernel\Exception\HttpException; +use Illuminate\Foundation\Validation\ValidationException; class Handler extends ExceptionHandler { @@ -14,7 +18,10 @@ class Handler extends ExceptionHandler { * @var array */ protected $dontReport = [ - 'Symfony\Component\HttpKernel\Exception\HttpException' + AuthorizationException::class, + HttpException::class, + ModelNotFoundException::class, + ValidationException::class, ]; /** @@ -27,6 +34,11 @@ class Handler extends ExceptionHandler { */ public function report(Exception $e) { + // don't show these errors in the logs + if ($e instanceof HttpResponseException) { + return false; + } + if (Utils::isNinja()) { Utils::logError(Utils::getErrorString($e)); return false; @@ -59,6 +71,9 @@ class Handler extends ExceptionHandler { } } + return parent::render($request, $e); + + /* // In production, except for maintenance mode, we'll show a custom error screen if (Utils::isNinjaProd() && !Utils::isDownForMaintenance()) { $data = [ @@ -70,5 +85,6 @@ class Handler extends ExceptionHandler { } else { return parent::render($request, $e); } + */ } }