Skip to content

Commit

Permalink
also hard error if the home storage can't be created
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Aug 19, 2022
1 parent 4b2eac6 commit 6358458
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/private/Files/Mount/MountPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ private function createStorage() {
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);
} 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.', $exception->getCode(), $exception);
} else {
\OC::$server->get(LoggerInterface::class)->error($exception->getMessage(), ['exception' => $exception]);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Files/Mount/MountPointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testInvalidStorage() {
$mountPoint = new \OC\Files\Mount\MountPoint(
// just use this because a real class is needed
'\Test\Files\Mount\DummyStorage',
'/mountpoint',
'/mountpoint/test',
null,
$loader
);
Expand Down

0 comments on commit 6358458

Please sign in to comment.