Updated exceptions package

This commit is contained in:
Graham Campbell 2015-10-07 14:20:53 +01:00
parent af62c5683f
commit 9bef541057
5 changed files with 6 additions and 31 deletions

View File

@ -67,10 +67,11 @@ class RedirectDisplayer implements DisplayerInterface
*
* @param \Exception $original
* @param \Exception $transformed
* @param int $code
*
* @return bool
*/
public function canDisplay(Exception $original, Exception $transformed)
public function canDisplay(Exception $original, Exception $transformed, $code)
{
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;

View File

@ -41,10 +41,11 @@ class ApiFilter
* @param \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[] $displayers
* @param \Exception $original
* @param \Exception $transformed
* @param int $code
*
* @return \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[]
*/
public function filter(array $displayers, Exception $original, Exception $transformed)
public function filter(array $displayers, Exception $original, Exception $transformed, $code)
{
if ($this->request->is('api*')) {
foreach ($displayers as $index => $displayer) {

View File

@ -1,27 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Exceptions;
use GrahamCampbell\Exceptions\ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var string[]
*/
protected $dontReport = [
NotFoundHttpException::class,
];
}

View File

@ -36,7 +36,7 @@ $app->singleton(
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'CachetHQ\Cachet\Exceptions\Handler'
'GrahamCampbell\Exceptions\ExceptionHandler'
);
/*

View File

@ -30,7 +30,7 @@
"graham-campbell/core": "^4.1",
"graham-campbell/markdown": "^5.1",
"graham-campbell/throttle": "^4.1",
"graham-campbell/exceptions": "^4.0",
"graham-campbell/exceptions": "^5.0",
"guzzlehttp/guzzle": "^6.1",
"jenssegers/date": "^3.0",
"mccool/laravel-auto-presenter": "^3.1",