Merge pull request #43294 from nextcloud/backport/42811/stable28

[stable28] make failure to load app commands non-fatal
This commit is contained in:
Ferdinand Thiessen 2024-02-03 21:18:09 +01:00 committed by GitHub
commit b96a2876c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);