improved exceptions

This commit is contained in:
kremsy
2014-04-19 23:14:37 +02:00
committed by Steffen Schröder
parent 7525b96ba1
commit ce22feee51
8 changed files with 52 additions and 82 deletions

View File

@ -11,14 +11,14 @@ use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\IconManager;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use Maniaplanet\DedicatedServer\Xmlrpc\ChangeInProgressException;
/**
* Class offering Commands to manage Maps
*
* @author steeffeen & kremsy
* @author steeffeen & kremsy
* @copyright ManiaControl Copyright © 2014 ManiaControl Team
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class MapCommands implements CommandListener, ManialinkPageAnswerListener, CallbackListener {
/*
@ -210,10 +210,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
try {
$this->maniaControl->client->restartMap();
} catch(Exception $e) {
if ($e->getMessage() != 'Change in progress.') {
throw $e;
}
} catch(ChangeInProgressException $e) {
}
}

View File

@ -553,7 +553,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$index = $this->maniaControl->mapManager->getMapIndex($map);
$this->maniaControl->client->jumpToMapIndex($index);
} catch(Exception $e) {
// TODO: is it even possible that an exception other than connection errors will be thrown? - remove try-catch?
//TODO temp added 19.04.2014
$this->maniaControl->errorHandler->triggerDebugNotice("Exception line 557 MapList.php" . $e->getMessage());
$this->maniaControl->chat->sendError("Error while Switching Map");
}
});