mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Throw CRITICAL error message on unhandled Exception on commands instead of crashing
This commit is contained in:
parent
d473ce13ee
commit
500a690cd0
@ -178,7 +178,11 @@ class SimpleCommandMap implements CommandMap{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$target->timings->startTiming();
|
$target->timings->startTiming();
|
||||||
$target->execute($sender, $sentCommandLabel, $args);
|
try{
|
||||||
|
$target->execute($sender, $sentCommandLabel, $args);
|
||||||
|
}catch(\Exception $e){
|
||||||
|
$this->server->getLogger()->critical("Unhandled exception executing command '". $commandLine ,"' in ". $target);
|
||||||
|
}
|
||||||
$target->timings->stopTiming();
|
$target->timings->stopTiming();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user