diff --git a/application/core/Chat.php b/application/core/Chat.php index 39f3bf48..1eccd8b0 100644 --- a/application/core/Chat.php +++ b/application/core/Chat.php @@ -137,6 +137,7 @@ class Chat { */ public function sendException(\Exception $exception, $login = null) { $message = "Exception occured: '{$exception->getMessage()}' ({$exception->getCode()})"; + $this->maniaControl->errorHandler->triggerDebugNotice($message); $this->sendError($message, $login); } diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 29e190df..01f66be6 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -651,7 +651,9 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1); } catch(Exception $e) { - $this->maniaControl->chat->sendException($e, $adminLogin); + if($e->getMessage() != "This player is not a spectator."){ + throw $e; + } } break; case self::ACTION_OPEN_PLAYER_DETAILED: @@ -723,7 +725,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $this->maniaControl->client->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); } catch(Exception $e) { - if ($e->getMessage() != 'Login unknown.' && $e->getMessage() != 'The player is not a spectator') { + if ($e->getMessage() != 'Login unknown.' && $e->getMessage() != 'The player is not a spectator.') { $this->maniaControl->chat->sendException($e); } }