mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 19:34:15 +00:00
Fixed some very unusual crashdumps reporting non-fatal errors when plugins use die() or exit()
This commit is contained in:
parent
9047c2c1ef
commit
4b4f2af9e3
@ -89,6 +89,16 @@ namespace pocketmine {
|
|||||||
* Enjoy it as much as I did writing it. I don't want to do it again.
|
* Enjoy it as much as I did writing it. I don't want to do it again.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
error_reporting(-1);
|
||||||
|
|
||||||
|
set_error_handler(function($severity, $message, $file, $line){
|
||||||
|
if((error_reporting() & $severity)){
|
||||||
|
throw new \ErrorException($message, 0, $severity, $file, $line);
|
||||||
|
}else{ //stfu operator
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
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;
|
||||||
echo "[CRITICAL] Please use the installer provided on the homepage." . PHP_EOL;
|
echo "[CRITICAL] Please use the installer provided on the homepage." . PHP_EOL;
|
||||||
@ -96,9 +106,9 @@ namespace pocketmine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(\Phar::running(true) !== ""){
|
if(\Phar::running(true) !== ""){
|
||||||
@define('pocketmine\PATH', \Phar::running(true) . "/");
|
define('pocketmine\PATH', \Phar::running(true) . "/");
|
||||||
}else{
|
}else{
|
||||||
@define('pocketmine\PATH', \getcwd() . DIRECTORY_SEPARATOR);
|
define('pocketmine\PATH', \getcwd() . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(version_compare("7.0", PHP_VERSION) > 0){
|
if(version_compare("7.0", PHP_VERSION) > 0){
|
||||||
@ -139,14 +149,6 @@ namespace pocketmine {
|
|||||||
|
|
||||||
set_time_limit(0); //Who set it to 30 seconds?!?!
|
set_time_limit(0); //Who set it to 30 seconds?!?!
|
||||||
|
|
||||||
error_reporting(-1);
|
|
||||||
|
|
||||||
set_error_handler(function($severity, $message, $file, $line){
|
|
||||||
if((error_reporting() & $severity)){
|
|
||||||
throw new \ErrorException($message, 0, $severity, $file, $line);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ini_set("allow_url_fopen", '1');
|
ini_set("allow_url_fopen", '1');
|
||||||
ini_set("display_errors", '1');
|
ini_set("display_errors", '1');
|
||||||
ini_set("display_startup_errors", '1');
|
ini_set("display_startup_errors", '1');
|
||||||
|
@ -2183,7 +2183,6 @@ class Server{
|
|||||||
}catch(\Throwable $e){
|
}catch(\Throwable $e){
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
$this->logger->critical($this->getLanguage()->translateString("pocketmine.crash.error", [$e->getMessage()]));
|
$this->logger->critical($this->getLanguage()->translateString("pocketmine.crash.error", [$e->getMessage()]));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//$this->checkMemory();
|
//$this->checkMemory();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user