Merge branch 'develop' into feature/api-integration-testing

This commit is contained in:
Dane Everitt 2018-03-21 22:25:16 -05:00
commit bde4d4187f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
61 changed files with 1017 additions and 453 deletions

View file

@ -5,6 +5,7 @@ namespace Pterodactyl\Exceptions;
use Exception;
use PDOException;
use Psr\Log\LoggerInterface;
use Illuminate\Container\Container;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Validation\ValidationException;
@ -31,7 +32,6 @@ class Handler extends ExceptionHandler
protected $dontReport = [
AuthenticationException::class,
AuthorizationException::class,
DisplayException::class,
HttpException::class,
ModelNotFoundException::class,
RecordNotFoundException::class,
@ -210,6 +210,17 @@ class Handler extends ExceptionHandler
return ['errors' => [array_merge($error, $override)]];
}
/**
* Return an array of exceptions that should not be reported.
*
* @param \Exception $exception
* @return bool
*/
public static function isReportable(Exception $exception): bool
{
return (new static(Container::getInstance()))->shouldReport($exception);
}
/**
* Convert an authentication exception into an unauthenticated response.
*