Changed how exceptions work and are logged, throw proper exceptions on tasks

This commit is contained in:
Shoghi Cervantes
2015-09-18 12:03:24 +02:00
parent 472fcfa4c7
commit 0bcf639a98
15 changed files with 52 additions and 78 deletions

View File

@ -249,10 +249,7 @@ class ServerScheduler{
$task->run($this->currentTick);
}catch(\Throwable $e){
Server::getInstance()->getLogger()->critical("Could not execute task " . $task->getTaskName() . ": " . $e->getMessage());
$logger = Server::getInstance()->getLogger();
if($logger instanceof MainLogger){
$logger->logException($e);
}
Server::getInstance()->getLogger()->logException($e);
}
$task->timings->stopTiming();
}