diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-03-26 11:27:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 11:27:52 +0100 |
commit | 1a55084930cbdd89e349cc0c9f4a2c2aeedb1e3c (patch) | |
tree | 48d2dd430293da40f46a1ae49c1b6e1e18833466 /lib | |
parent | 47ac9071492b2f1f1055bbc4ddcfb65aa28d8e1e (diff) | |
parent | 0ea2913ac330d9c9dced8c202dc9fc9d2ff4fcf7 (diff) | |
download | nextcloud-server-1a55084930cbdd89e349cc0c9f4a2c2aeedb1e3c.tar.gz nextcloud-server-1a55084930cbdd89e349cc0c9f4a2c2aeedb1e3c.zip |
Merge pull request #44270 from nextcloud/fix/catch-setupcheck-trowables
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/SetupCheck/SetupCheckManager.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/SetupCheck/SetupCheckManager.php b/lib/private/SetupCheck/SetupCheckManager.php index b8b6cfa11e7..8f4efa6794b 100644 --- a/lib/private/SetupCheck/SetupCheckManager.php +++ b/lib/private/SetupCheck/SetupCheckManager.php @@ -30,6 +30,7 @@ use OC\AppFramework\Bootstrap\Coordinator; use OCP\Server; use OCP\SetupCheck\ISetupCheck; use OCP\SetupCheck\ISetupCheckManager; +use OCP\SetupCheck\SetupResult; use Psr\Log\LoggerInterface; class SetupCheckManager implements ISetupCheckManager { @@ -46,7 +47,12 @@ class SetupCheckManager implements ISetupCheckManager { /** @var ISetupCheck $setupCheckObject */ $setupCheckObject = Server::get($setupCheck->getService()); $this->logger->debug('Running check '.get_class($setupCheckObject)); - $setupResult = $setupCheckObject->run(); + try { + $setupResult = $setupCheckObject->run(); + } catch (\Throwable $t) { + $setupResult = SetupResult::error("An exception occured while running the setup check:\n$t"); + $this->logger->error('Exception running check '.get_class($setupCheckObject).': '.$t->getMessage(), ['exception' => $t]); + } $setupResult->setName($setupCheckObject->getName()); $category = $setupCheckObject->getCategory(); $results[$category] ??= []; |