From 784b059a0132e0e8685a9993bd74d570a5b75ec6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 5 May 2021 10:41:18 +0200 Subject: Don't break OCC if an app is breaking in it's Application class Signed-off-by: Joas Schilling --- lib/private/AppFramework/Bootstrap/Coordinator.php | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'lib/private/AppFramework') diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php index 33b02c0291f..ad55ea3912e 100644 --- a/lib/private/AppFramework/Bootstrap/Coordinator.php +++ b/lib/private/AppFramework/Bootstrap/Coordinator.php @@ -113,21 +113,24 @@ class Coordinator { */ $appNameSpace = App::buildAppNamespace($appId); $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; - if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) { - try { - /** @var IBootstrap|App $application */ - $apps[$appId] = $application = $this->serverContainer->query($applicationClassName); - } catch (QueryException $e) { - // Weird, but ok - continue; - } - try { + try { + if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) { + try { + /** @var IBootstrap|App $application */ + $apps[$appId] = $application = $this->serverContainer->query($applicationClassName); + } catch (QueryException $e) { + // Weird, but ok + continue; + } + $application->register($this->registrationContext->for($appId)); - } catch (Throwable $e) { - $this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [ - 'exception' => $e, - ]); } + } catch (Throwable $e) { + $this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [ + 'exception' => $e, + 'app' => $appId, + ]); + continue; } } -- cgit v1.2.3