1
0
Fork 0
forked from mirror/pixelfed

Update exception handler

This commit is contained in:
Daniel Supernault 2021-12-31 01:12:33 -07:00
parent c481e473d8
commit f4e12c42b3
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -5,7 +5,7 @@ namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable; use Throwable;
use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Exception\OAuthServerException;
use Zttp\ConnectionException; use
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@ -16,7 +16,9 @@ class Handler extends ExceptionHandler
*/ */
protected $dontReport = [ protected $dontReport = [
OAuthServerException::class, OAuthServerException::class,
ConnectionException::class \Zttp\ConnectionException::class,
\GuzzleHttp\Exception\ConnectException::class,
\Illuminate\Http\Client\ConnectionException::class
]; ];
/** /**
@ -51,6 +53,10 @@ class Handler extends ExceptionHandler
$this->reportable(function (\BadMethodCallException $e) { $this->reportable(function (\BadMethodCallException $e) {
return app()->environment() !== 'production'; return app()->environment() !== 'production';
}); });
$this->reportable(function (\Illuminate\Http\Client\ConnectionException $e) {
return app()->environment() !== 'production';
});
} }
/** /**