fixed exception
This commit is contained in:
parent
a0c1e4e70d
commit
c82f14b07c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user