mirror of
https://github.com/nextcloud/server.git
synced 2026-06-04 22:35:24 -04:00
Merge pull request #44270 from nextcloud/fix/catch-setupcheck-trowables
This commit is contained in:
commit
1a55084930
1 changed files with 7 additions and 1 deletions
|
|
@ -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] ??= [];
|
||||
|
|
|
|||
Loading…
Reference in a new issue