- refactored many try-catch clauses

- added todos for validating catching
This commit is contained in:
Steffen Schröder
2014-02-13 14:21:25 +01:00
parent 10dfd6b0cb
commit 4197dc82ff
23 changed files with 213 additions and 293 deletions

View File

@ -15,6 +15,7 @@ use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\Plugin;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
class SlotMachinePlugin implements Plugin, CallbackListener, ManialinkPageAnswerListener, TimerListener {
/**
@ -467,7 +468,8 @@ class SlotMachinePlugin implements Plugin, CallbackListener, ManialinkPageAnswer
try {
$billId = $this->maniaControl->client->pay($player->login, (int)$balance, $message);
} catch(\Exception $e) {
} catch(Exception $e) {
// TODO: handle errors like 'too few server planets' - throw other like connection errors
return;
}