Path: blob/1.0-develop/app/Exceptions/Http/Server/ServerStateConflictException.php
10284 views
<?php12namespace Pterodactyl\Exceptions\Http\Server;34use Pterodactyl\Models\Server;5use Symfony\Component\HttpKernel\Exception\ConflictHttpException;67class ServerStateConflictException extends ConflictHttpException8{9/**10* Exception thrown when the server is in an unsupported state for API access or11* certain operations within the codebase.12*/13public function __construct(Server $server, ?\Throwable $previous = null)14{15$message = 'This server is currently in an unsupported state, please try again later.';16if ($server->isSuspended()) {17$message = 'This server is currently suspended and the functionality requested is unavailable.';18} elseif ($server->node->isUnderMaintenance()) {19$message = 'The node of this server is currently under maintenance and the functionality requested is unavailable.';20} elseif (!$server->isInstalled()) {21$message = 'This server has not yet completed its installation process, please try again later.';22} elseif ($server->status === Server::STATUS_RESTORING_BACKUP) {23$message = 'This server is currently restoring from a backup, please try again later.';24} elseif (!is_null($server->transfer)) {25$message = 'This server is currently being transferred to a new machine, please try again later.';26}2728parent::__construct($message, $previous);29}30}313233