File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 44
55use Psr \Log \LoggerInterface ;
66use Pterodactyl \Models \Server ;
7- use GuzzleHttp \Exception \RequestException ;
87use Illuminate \Database \ConnectionInterface ;
98use Pterodactyl \Repositories \Eloquent \ServerRepository ;
109use 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
You can’t perform that action at this time.
0 commit comments