fixed exception

This commit is contained in:
kremsy 2014-04-14 19:04:02 +02:00 committed by Steffen Schröder
parent a0c1e4e70d
commit c82f14b07c
2 changed files with 5 additions and 2 deletions

View File

@ -137,6 +137,7 @@ class Chat {
*/ */
public function sendException(\Exception $exception, $login = null) { public function sendException(\Exception $exception, $login = null) {
$message = "Exception occured: '{$exception->getMessage()}' ({$exception->getCode()})"; $message = "Exception occured: '{$exception->getMessage()}' ({$exception->getCode()})";
$this->maniaControl->errorHandler->triggerDebugNotice($message);
$this->sendError($message, $login); $this->sendError($message, $login);
} }

View File

@ -651,7 +651,9 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
$this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
$this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1); $this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1);
} catch(Exception $e) { } catch(Exception $e) {
$this->maniaControl->chat->sendException($e, $adminLogin); if($e->getMessage() != "This player is not a spectator."){
throw $e;
}
} }
break; break;
case self::ACTION_OPEN_PLAYER_DETAILED: 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->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE);
$this->maniaControl->client->spectatorReleasePlayerSlot($target->login); $this->maniaControl->client->spectatorReleasePlayerSlot($target->login);
} catch(Exception $e) { } 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); $this->maniaControl->chat->sendException($e);
} }
} }