From 2ae38ed1fa69b17d2889cfbcf4fea304f2ec7d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 19 Jul 2014 23:39:25 +0200 Subject: [PATCH] improved exception catching --- application/core/Players/Actions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/core/Players/Actions.php b/application/core/Players/Actions.php index b4d9ada8..40ac5099 100644 --- a/application/core/Players/Actions.php +++ b/application/core/Players/Actions.php @@ -15,6 +15,7 @@ use Maniaplanet\DedicatedServer\Xmlrpc\AlreadyInListException; use Maniaplanet\DedicatedServer\Xmlrpc\FaultException; use Maniaplanet\DedicatedServer\Xmlrpc\NotInListException; use Maniaplanet\DedicatedServer\Xmlrpc\PlayerStateException; +use Maniaplanet\DedicatedServer\Xmlrpc\ServerOptionsException; use Maniaplanet\DedicatedServer\Xmlrpc\UnknownPlayerException; /** @@ -189,8 +190,7 @@ class Actions { try { $this->maniaControl->client->forceSpectator($target->login, $spectatorState); - } catch (FaultException $exception) { - // TODO: replace by more specific exception "There are too many spectators" + } catch (ServerOptionsException $exception) { $this->maniaControl->chat->sendException($exception, $admin->login); return; } @@ -205,6 +205,7 @@ class Actions { try { $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); } catch (PlayerStateException $e) { + } catch (UnknownPlayerException $e) { } } }