diff --git a/app/Services/Servers/ServerDeletionService.php b/app/Services/Servers/ServerDeletionService.php index d4ce9a896..8d7217769 100644 --- a/app/Services/Servers/ServerDeletionService.php +++ b/app/Services/Servers/ServerDeletionService.php @@ -2,6 +2,7 @@ namespace Pterodactyl\Services\Servers; +use Exception; use Psr\Log\LoggerInterface; use Pterodactyl\Models\Server; use Illuminate\Database\ConnectionInterface; @@ -109,7 +110,15 @@ class ServerDeletionService $this->connection->transaction(function () use ($server) { $this->databaseRepository->setColumns('id')->findWhere([['server_id', '=', $server->id]])->each(function ($item) { - $this->databaseManagementService->delete($item->id); + try { + $this->databaseManagementService->delete($item->id); + } catch (Exception $exception) { + if ($this->force) { + $this->writer->warning($exception); + } else { + throw $exception; + } + } }); $this->repository->delete($server->id);