Skip to content

Commit

Permalink
RakLibServer: replace "RakLib crashed!" with a less useless message
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jul 22, 2019
1 parent d47516b commit 874db2d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server/RakLibServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace raklib\server;

use function error_get_last;
use pocketmine\snooze\SleeperNotifier;
use raklib\RakLib;
use raklib\utils\InternetAddress;
Expand Down Expand Up @@ -183,7 +184,12 @@ public function readThreadToMainPacket() : ?string{

public function shutdownHandler(){
if($this->shutdown !== true){
$this->getLogger()->emergency("RakLib crashed!");
$error = error_get_last();
if($error !== null){
$this->logger->emergency("Fatal error: " . $error["message"] . " in " . $error["file"] . " on line " . $error["line"]);
}else{
$this->logger->emergency("RakLib shutdown unexpectedly");
}
}
}

Expand Down

0 comments on commit 874db2d

Please sign in to comment.