mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 13:14:54 +00:00
Set ErrorException handler on AsyncWorkers
This commit is contained in:
parent
f565791e41
commit
7ba193dc2e
@ -105,13 +105,15 @@ namespace pocketmine {
|
|||||||
|
|
||||||
error_reporting(-1);
|
error_reporting(-1);
|
||||||
|
|
||||||
set_error_handler(function($severity, $message, $file, $line){
|
function error_handler($severity, $message, $file, $line){
|
||||||
if(error_reporting() & $severity){
|
if(error_reporting() & $severity){
|
||||||
throw new \ErrorException($message, 0, $severity, $file, $line);
|
throw new \ErrorException($message, 0, $severity, $file, $line);
|
||||||
}else{ //stfu operator
|
}else{ //stfu operator
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
set_error_handler('\pocketmine\error_handler');
|
||||||
|
|
||||||
if(!extension_loaded("phar")){
|
if(!extension_loaded("phar")){
|
||||||
echo "[CRITICAL] Unable to find the Phar extension." . PHP_EOL;
|
echo "[CRITICAL] Unable to find the Phar extension." . PHP_EOL;
|
||||||
|
@ -41,6 +41,9 @@ class AsyncWorker extends Worker{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function run(){
|
public function run(){
|
||||||
|
error_reporting(-1);
|
||||||
|
set_error_handler('\pocketmine\error_handler');
|
||||||
|
|
||||||
$this->registerClassLoader();
|
$this->registerClassLoader();
|
||||||
$this->logger->registerStatic();
|
$this->logger->registerStatic();
|
||||||
gc_enable();
|
gc_enable();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user