Skip to content

Commit c96bad4

Browse files
committed
FIx force deletion
1 parent 446d5be commit c96bad4

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

app/Services/Servers/ServerDeletionService.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Psr\Log\LoggerInterface;
66
use Pterodactyl\Models\Server;
7-
use GuzzleHttp\Exception\RequestException;
87
use Illuminate\Database\ConnectionInterface;
98
use Pterodactyl\Repositories\Eloquent\ServerRepository;
109
use Pterodactyl\Repositories\Eloquent\DatabaseRepository;
@@ -100,17 +99,11 @@ public function handle(Server $server)
10099
{
101100
try {
102101
$this->daemonServerRepository->setServer($server)->delete();
103-
} catch (RequestException $exception) {
104-
$response = $exception->getResponse();
105-
106-
if (is_null($response) || (! is_null($response) && $response->getStatusCode() !== 404)) {
107-
// If not forcing the deletion, throw an exception, otherwise just log it and
108-
// continue with server deletion process in the panel.
109-
if (! $this->force) {
110-
throw new DaemonConnectionException($exception);
111-
} else {
112-
$this->writer->warning($exception);
113-
}
102+
} catch (DaemonConnectionException $exception) {
103+
if ($this->force) {
104+
$this->writer->warning($exception);
105+
} else {
106+
throw $exception;
114107
}
115108
}
116109

0 commit comments

Comments
 (0)