diff --git a/application/clicommands/MigrateCommand.php b/application/clicommands/MigrateCommand.php index 4453bd7b3..94816b82f 100644 --- a/application/clicommands/MigrateCommand.php +++ b/application/clicommands/MigrateCommand.php @@ -397,7 +397,7 @@ public function roleAction(): void try { $rolesConfig->saveIni(); } catch (NotWritableError $error) { - Logger::error('%s: %s', $error->getMessage(), $error->getPrevious()->getMessage()); + Logger::error($error); if ($this->skipMigration) { Logger::error('Failed to transform icingadb restrictions'); } else { @@ -508,7 +508,7 @@ public function dashboardAction(): void try { $dashboardsConfig->saveIni(); } catch (NotWritableError $error) { - Logger::error('%s: %s', $error->getMessage(), $error->getPrevious()->getMessage()); + Logger::error($error); $rc = 256; } } @@ -616,7 +616,7 @@ private function transformNavigationItems(Config $config, string $owner, &$rc): try { $config->saveIni(); } catch (NotWritableError $error) { - Logger::error('%s: %s', $error->getMessage(), $error->getPrevious()->getMessage()); + Logger::error($error); $rc = 256; return false; @@ -714,7 +714,7 @@ private function migrateNavigationItems(Config $config, string $owner, string $p unlink($config->getConfigFile()); } } catch (NotWritableError $error) { - Logger::error('%s: %s', $error->getMessage(), $error->getPrevious()->getMessage()); + Logger::error($error); $rc = 256; return false; @@ -737,11 +737,7 @@ private function readFromIni($path, &$rc) try { $config = Config::fromIni($path); } catch (NotReadableError $error) { - if ($error->getPrevious() !== null) { - Logger::error('%s: %s', $error->getMessage(), $error->getPrevious()->getMessage()); - } else { - Logger::error($error->getMessage()); - } + Logger::error($error); $config = new Config(); $rc = 128;