make failure to load app commands non-fatal

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2024-01-15 16:28:50 +01:00 committed by backportbot[bot]
parent 30706d4f41
commit 44d3a4ffba

View File

@ -121,7 +121,14 @@ class Application {
// 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);