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

@ -141,9 +141,7 @@ class Network{
}catch(\Throwable $e){
$logger = $this->server->getLogger();
if(\pocketmine\DEBUG > 1){
if($logger instanceof MainLogger){
$logger->logException($e);
}
$logger->logException($e);
}
$interface->emergencyShutdown();
@ -237,10 +235,8 @@ class Network{
}catch(\Throwable $e){
if(\pocketmine\DEBUG > 1){
$logger = $this->server->getLogger();
if($logger instanceof MainLogger){
$logger->debug("BatchPacket " . " 0x" . bin2hex($packet->payload));
$logger->logException($e);
}
$logger->debug("BatchPacket " . " 0x" . bin2hex($packet->payload));
$logger->logException($e);
}
}
}

View File

@ -139,10 +139,8 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
}catch(\Throwable $e){
if(\pocketmine\DEBUG > 1 and isset($pk)){
$logger = $this->server->getLogger();
if($logger instanceof MainLogger){
$logger->debug("Packet " . get_class($pk) . " 0x" . bin2hex($packet->buffer));
$logger->logException($e);
}
$logger->debug("Packet " . get_class($pk) . " 0x" . bin2hex($packet->buffer));
$logger->logException($e);
}
if(isset($this->players[$identifier])){