Use ServerTransferringException

This commit is contained in:
Matthew Penner 2020-12-17 10:37:14 -07:00
parent e69d9b2c26
commit 37cfa151b6

View file

@ -9,6 +9,7 @@ use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
use Symfony\Component\HttpKernel\Exception\ConflictHttpException; use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Pterodactyl\Exceptions\Http\Server\ServerTransferringException;
class AuthenticateServerAccess class AuthenticateServerAccess
{ {
@ -81,7 +82,7 @@ class AuthenticateServerAccess
if (! is_null($server->transfer)) { if (! is_null($server->transfer)) {
if (! $user->root_admin || ($user->root_admin && ! $request->routeIs($this->except))) { if (! $user->root_admin || ($user->root_admin && ! $request->routeIs($this->except))) {
throw new ConflictHttpException('Server is currently being transferred.'); throw new ServerTransferringException();
} }
} }
} }