Skip to content

Commit 860caa0

Browse files
icewind1991blizzz
authored andcommitted
make failure to load app commands non-fatal
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 50fffa8 commit 860caa0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/private/Console/Application.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ public function loadCommands(
121121
// load commands using info.xml
122122
$info = $appManager->getAppInfo($app);
123123
if (isset($info['commands'])) {
124-
$this->loadCommandsFromInfoXml($info['commands']);
124+
try {
125+
$this->loadCommandsFromInfoXml($info['commands']);
126+
} catch (\Throwable $e) {
127+
$output->writeln("<error>" . $e->getMessage() . "</error>");
128+
$this->logger->error($e->getMessage(), [
129+
'exception' => $e,
130+
]);
131+
}
125132
}
126133
// load from register_command.php
127134
\OC_App::registerAutoloading($app, $appPath);

0 commit comments

Comments
 (0)