Skip to content

Commit

Permalink
Merge pull request #43293 from nextcloud/backport/42811/stable27
Browse files Browse the repository at this point in the history
[stable27] make failure to load app commands non-fatal
  • Loading branch information
come-nc committed Feb 5, 2024
2 parents a71b6ae + 226fa9b commit 3ad0dfb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/private/Console/Application.php
Expand Up @@ -128,7 +128,14 @@ public function loadCommands(
// load commands using info.xml
$info = $appManager->getAppInfo($app);
if (isset($info['commands'])) {
$this->loadCommandsFromInfoXml($info['commands']);
try {
$this->loadCommandsFromInfoXml($info['commands']);
} catch (\Throwable $e) {
$output->writeln("<error>" . $e->getMessage() . "</error>");
$this->logger->error($e->getMessage(), [
'exception' => $e,
]);
}
}
// load from register_command.php
\OC_App::registerAutoloading($app, $appPath);
Expand Down

0 comments on commit 3ad0dfb

Please sign in to comment.