Updated exceptions package
This commit is contained in:
@@ -67,10 +67,11 @@ class RedirectDisplayer implements DisplayerInterface
|
|||||||
*
|
*
|
||||||
* @param \Exception $original
|
* @param \Exception $original
|
||||||
* @param \Exception $transformed
|
* @param \Exception $transformed
|
||||||
|
* @param int $code
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function canDisplay(Exception $original, Exception $transformed)
|
public function canDisplay(Exception $original, Exception $transformed, $code)
|
||||||
{
|
{
|
||||||
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;
|
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,11 @@ class ApiFilter
|
|||||||
* @param \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[] $displayers
|
* @param \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[] $displayers
|
||||||
* @param \Exception $original
|
* @param \Exception $original
|
||||||
* @param \Exception $transformed
|
* @param \Exception $transformed
|
||||||
|
* @param int $code
|
||||||
*
|
*
|
||||||
* @return \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[]
|
* @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*')) {
|
if ($this->request->is('api*')) {
|
||||||
foreach ($displayers as $index => $displayer) {
|
foreach ($displayers as $index => $displayer) {
|
||||||
|
|||||||
@@ -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,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -36,7 +36,7 @@ $app->singleton(
|
|||||||
|
|
||||||
$app->singleton(
|
$app->singleton(
|
||||||
'Illuminate\Contracts\Debug\ExceptionHandler',
|
'Illuminate\Contracts\Debug\ExceptionHandler',
|
||||||
'CachetHQ\Cachet\Exceptions\Handler'
|
'GrahamCampbell\Exceptions\ExceptionHandler'
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"graham-campbell/core": "^4.1",
|
"graham-campbell/core": "^4.1",
|
||||||
"graham-campbell/markdown": "^5.1",
|
"graham-campbell/markdown": "^5.1",
|
||||||
"graham-campbell/throttle": "^4.1",
|
"graham-campbell/throttle": "^4.1",
|
||||||
"graham-campbell/exceptions": "^4.0",
|
"graham-campbell/exceptions": "^5.0",
|
||||||
"guzzlehttp/guzzle": "^6.1",
|
"guzzlehttp/guzzle": "^6.1",
|
||||||
"jenssegers/date": "^3.0",
|
"jenssegers/date": "^3.0",
|
||||||
"mccool/laravel-auto-presenter": "^3.1",
|
"mccool/laravel-auto-presenter": "^3.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user