Drop pocketmine.plugin.fileError in favour of pocketmine.plugin.loadError

fileError was unnecessarily noisy, putting the directory path on the console twice. This conveys just as much information but with less wasted space.
This commit is contained in:
Dylan K. Taylor 2021-10-05 23:31:00 +01:00
parent fec48003d9
commit a101d1cdf9
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 3 additions and 13 deletions

@ -1 +1 @@
Subproject commit dcfe3ff1888b2d3adecc00c14870717ed55824cc
Subproject commit c940b9f17188548f78d0dc5fdd4e607c703b7952

View File

@ -1702,14 +1702,6 @@ final class KnownTranslationFactory{
]);
}
public static function pocketmine_plugin_fileError(Translatable|string $param0, Translatable|string $param1, Translatable|string $param2) : Translatable{
return new Translatable(KnownTranslationKeys::POCKETMINE_PLUGIN_FILEERROR, [
0 => $param0,
1 => $param1,
2 => $param2,
]);
}
public static function pocketmine_plugin_genericLoadError(Translatable|string $param0) : Translatable{
return new Translatable(KnownTranslationKeys::POCKETMINE_PLUGIN_GENERICLOADERROR, [
0 => $param0,

View File

@ -357,7 +357,6 @@ final class KnownTranslationKeys{
public const POCKETMINE_PLUGIN_DISABLE = "pocketmine.plugin.disable";
public const POCKETMINE_PLUGIN_DUPLICATEERROR = "pocketmine.plugin.duplicateError";
public const POCKETMINE_PLUGIN_ENABLE = "pocketmine.plugin.enable";
public const POCKETMINE_PLUGIN_FILEERROR = "pocketmine.plugin.fileError";
public const POCKETMINE_PLUGIN_GENERICLOADERROR = "pocketmine.plugin.genericLoadError";
public const POCKETMINE_PLUGIN_INCOMPATIBLEAPI = "pocketmine.plugin.incompatibleAPI";
public const POCKETMINE_PLUGIN_INCOMPATIBLEOS = "pocketmine.plugin.incompatibleOS";

View File

@ -247,14 +247,13 @@ class PluginManager{
try{
$description = $loader->getPluginDescription($file);
}catch(PluginDescriptionParseException $e){
$this->server->getLogger()->error($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_fileError(
$this->server->getLogger()->error($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_loadError(
$file,
$directory,
KnownTranslationFactory::pocketmine_plugin_invalidManifest($e->getMessage())
)));
continue;
}catch(\RuntimeException $e){ //TODO: more specific exception handling
$this->server->getLogger()->error($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_fileError($file, $directory, $e->getMessage())));
$this->server->getLogger()->error($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_loadError($file, $e->getMessage())));
$this->server->getLogger()->logException($e);
continue;
}