also hard error if the home storage can't be created

Signed-off-by: Robin Appelman <robin@icewind.nl>
setupmanager-lazy-user
Robin Appelman 2 years ago
parent 1214c4fea1
commit 0ae7653afb
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB

@ -171,7 +171,9 @@ class MountPoint implements IMountPoint {
$this->invalidStorage = true;
if ($this->mountPoint === '/') {
// the root storage could not be initialized, show the user!
throw new \Exception('The root storage could not be initialized. Please contact your local administrator.', $exception->getCode(), $exception);
throw new \Exception('The root storage could not be initialized. Please contact your local administrator.', (int)$exception->getCode(), $exception);
} elseif (substr_count($this->mountPoint, '/') == 2) { // home mount is `/<userid/`, all extra mounts have more /'s
throw new \Exception('The home storage could not be initialized. Please contact your local administrator.', (int)$exception->getCode(), $exception);
} else {
\OC::$server->get(LoggerInterface::class)->error($exception->getMessage(), ['exception' => $exception]);
}

@ -56,7 +56,7 @@ class MountPointTest extends \Test\TestCase {
$mountPoint = new \OC\Files\Mount\MountPoint(
// just use this because a real class is needed
'\Test\Files\Mount\DummyStorage',
'/mountpoint',
'/mountpoint/test',
null,
$loader
);

@ -33,6 +33,7 @@ use OC\Files\Mount\RootMountProvider;
use OC\Files\SetupManager;
use OC\Template\Base;
use OC\User\DisplayNameCache;
use OC\User\Manager;
use OCP\Command\IBus;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Defaults;
@ -149,6 +150,10 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
call_user_func([$this, $methodName]);
}
}
/** @var Manager $userManager */
$userManager = \OC::$server->get(Manager::class);
$userManager->getDisplayNameCache()->clear();
}
protected function onNotSuccessfulTest(\Throwable $t): void {
@ -202,7 +207,9 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
}
}
\OC::$server->get(DisplayNameCache::class)->clear();
/** @var Manager $userManager */
$userManager = \OC::$server->get(Manager::class);
$userManager->getDisplayNameCache()->clear();
}
/**

Loading…
Cancel
Save