mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 10:01:53 +00:00
Config: don't catch-all in save()
This commit is contained in:
parent
c90d1faa81
commit
b0060caaf7
@ -23,9 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\utils;
|
namespace pocketmine\utils;
|
||||||
|
|
||||||
use pocketmine\Server;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Config Class for simple config manipulation of multiple formats.
|
* Config Class for simple config manipulation of multiple formats.
|
||||||
*/
|
*/
|
||||||
@ -189,7 +186,6 @@ class Config{
|
|||||||
*/
|
*/
|
||||||
public function save() : bool{
|
public function save() : bool{
|
||||||
if($this->correct){
|
if($this->correct){
|
||||||
try{
|
|
||||||
$content = null;
|
$content = null;
|
||||||
switch($this->type){
|
switch($this->type){
|
||||||
case Config::PROPERTIES:
|
case Config::PROPERTIES:
|
||||||
@ -212,13 +208,6 @@ class Config{
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_put_contents($this->file, $content);
|
file_put_contents($this->file, $content);
|
||||||
}catch(\Throwable $e){
|
|
||||||
$logger = Server::getInstance()->getLogger();
|
|
||||||
$logger->critical("Could not save Config " . $this->file . ": " . $e->getMessage());
|
|
||||||
if(\pocketmine\DEBUG > 1){
|
|
||||||
$logger->logException($e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->changed = false;
|
$this->changed = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user