Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/dav/lib/BackgroundJob/EventReminderJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace OCA\DAV\BackgroundJob;

use OC\User\NoUserException;
use OCA\DAV\CalDAV\Reminder\NotificationProvider\ProviderNotAvailableException;
use OCA\DAV\CalDAV\Reminder\NotificationTypeDoesNotExistException;
use OCA\DAV\CalDAV\Reminder\ReminderService;
Expand All @@ -34,7 +33,6 @@ public function __construct(
/**
* @throws ProviderNotAvailableException
* @throws NotificationTypeDoesNotExistException
* @throws NoUserException
*/
#[\Override]
public function run($argument):void {
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/BackgroundJob/UploadCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace OCA\DAV\BackgroundJob;

use OC\User\NoUserException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\TimedJob;
Expand All @@ -19,6 +18,7 @@
use OCP\Files\NotFoundException;
use OCP\IConfig;
use OCP\Server;
use OCP\User\Exceptions\UserNotFoundException;
use Psr\Log\LoggerInterface;

class UploadCleanup extends TimedJob {
Expand Down Expand Up @@ -46,7 +46,7 @@ protected function run($argument) {
/** @var Folder $uploads */
$uploads = $userRoot->get('uploads');
$uploadFolder = $uploads->get($folder);
} catch (NotFoundException|NoUserException $e) {
} catch (NotFoundException|UserNotFoundException $e) {
$this->jobList->remove(self::class, $argument);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use OC\AppFramework\Http\Request;
use OC\FilesMetadata\Model\FilesMetadata;
use OC\User\NoUserException;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
use OCA\Files_Sharing\External\Mount as SharingExternalMount;
use OCP\Accounts\IAccountManager;
Expand All @@ -29,6 +28,7 @@
use OCP\IRequest;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\User\Exceptions\UserNotFoundException;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\IFile;
Expand Down Expand Up @@ -382,7 +382,7 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
// Check if the user published their display name
try {
$ownerAccount = $this->accountManager->getAccount($owner);
} catch (NoUserException) {
} catch (UserNotFoundException) {
// do not lock process if owner is not local
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/SystemTag/SystemTagsInUseCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

use OC\SystemTag\SystemTag;
use OC\SystemTag\SystemTagsInFilesDetector;
use OC\User\NoUserException;
use OCP\Files\IRootFolder;
use OCP\Files\NotPermittedException;
use OCP\IUserSession;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\ISystemTagObjectMapper;
use OCP\User\Exceptions\UserNotFoundException;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\SimpleCollection;
Expand Down Expand Up @@ -63,7 +63,7 @@ public function getChildren(): array {
if ($user) {
$userFolder = $this->rootFolder->getUserFolder($user->getUID());
}
} catch (NoUserException) {
} catch (UserNotFoundException) {
// will throw a Sabre exception in the next step.
}
if ($user === null || $userFolder === null) {
Expand Down
4 changes: 2 additions & 2 deletions apps/files/lib/Service/OwnershipTransferService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Exception;
use OC\Files\Filesystem;
use OC\Files\View;
use OC\User\NoUserException;
use OCA\Encryption\Util;
use OCA\Files\Exception\TransferOwnershipException;
use OCA\Files_External\Config\ConfigAdapter;
Expand All @@ -35,6 +34,7 @@
use OCP\Share\Events\ShareTransferredEvent;
use OCP\Share\IManager as IShareManager;
use OCP\Share\IShare;
use OCP\User\Exceptions\UserNotFoundException;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -67,7 +67,7 @@ public function __construct(
* @param OutputInterface|null $output
* @param bool $move
* @throws TransferOwnershipException
* @throws NoUserException
* @throws UserNotFoundException
*/
public function transfer(
IUser $sourceUser,
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

use OC\Core\Command\Base;
use OC\Files\Filesystem;
use OC\User\NoUserException;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\DefinitionParameter;
Expand All @@ -22,6 +21,7 @@
use OCP\AppFramework\Http;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\User\Exceptions\UserNotFoundException;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -179,7 +179,7 @@ protected function getStorageService(string $userId): StoragesService {

$user = $this->userManager->get($userId);
if (is_null($user)) {
throw new NoUserException("user $userId not found");
throw UserNotFoundException::createForUser($userId);
}
$this->userSession->setUser($user);
return $this->userService;
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace OCA\Files_External\Command;

use OC\Core\Command\Base;
use OC\User\NoUserException;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\BackendService;
use OCA\Files_External\Service\GlobalStoragesService;
Expand All @@ -18,6 +17,7 @@
use OCA\Files_External\Service\UserStoragesService;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\User\Exceptions\UserNotFoundException;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -174,7 +174,7 @@ protected function getStorageService(string $userId): StoragesService {

$user = $this->userManager->get($userId);
if (is_null($user)) {
throw new NoUserException("user $userId not found");
throw UserNotFoundException::createForUser($userId);
}
$this->userSession->setUser($user);
return $this->userService;
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/Command/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
namespace OCA\Files_External\Command;

use OC\Core\Command\Base;
use OC\User\NoUserException;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\Service\GlobalStoragesService;
use OCA\Files_External\Service\StoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\User\Exceptions\UserNotFoundException;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -234,7 +234,7 @@ protected function getStorageService(string $userId): StoragesService {

$user = $this->userManager->get($userId);
if (is_null($user)) {
throw new NoUserException("user $userId not found");
throw UserNotFoundException::createForUser($userId);
}
$this->userSession->setUser($user);
return $this->userService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
'OCA\\FilesReminders\\Db\\ReminderMapper' => $baseDir . '/../lib/Db/ReminderMapper.php',
'OCA\\FilesReminders\\Exception\\NodeNotFoundException' => $baseDir . '/../lib/Exception/NodeNotFoundException.php',
'OCA\\FilesReminders\\Exception\\ReminderNotFoundException' => $baseDir . '/../lib/Exception/ReminderNotFoundException.php',
'OCA\\FilesReminders\\Exception\\UserNotFoundException' => $baseDir . '/../lib/Exception/UserNotFoundException.php',
'OCA\\FilesReminders\\Listener\\LoadAdditionalScriptsListener' => $baseDir . '/../lib/Listener/LoadAdditionalScriptsListener.php',
'OCA\\FilesReminders\\Listener\\NodeDeletedListener' => $baseDir . '/../lib/Listener/NodeDeletedListener.php',
'OCA\\FilesReminders\\Listener\\SabrePluginAddListener' => $baseDir . '/../lib/Listener/SabrePluginAddListener.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ComposerStaticInitFilesReminders
'OCA\\FilesReminders\\Db\\ReminderMapper' => __DIR__ . '/..' . '/../lib/Db/ReminderMapper.php',
'OCA\\FilesReminders\\Exception\\NodeNotFoundException' => __DIR__ . '/..' . '/../lib/Exception/NodeNotFoundException.php',
'OCA\\FilesReminders\\Exception\\ReminderNotFoundException' => __DIR__ . '/..' . '/../lib/Exception/ReminderNotFoundException.php',
'OCA\\FilesReminders\\Exception\\UserNotFoundException' => __DIR__ . '/..' . '/../lib/Exception/UserNotFoundException.php',
'OCA\\FilesReminders\\Listener\\LoadAdditionalScriptsListener' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScriptsListener.php',
'OCA\\FilesReminders\\Listener\\NodeDeletedListener' => __DIR__ . '/..' . '/../lib/Listener/NodeDeletedListener.php',
'OCA\\FilesReminders\\Listener\\SabrePluginAddListener' => __DIR__ . '/..' . '/../lib/Listener/SabrePluginAddListener.php',
Expand Down
15 changes: 0 additions & 15 deletions apps/files_reminders/lib/Exception/UserNotFoundException.php

This file was deleted.

4 changes: 2 additions & 2 deletions apps/files_reminders/lib/Service/ReminderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use OCA\FilesReminders\Db\ReminderMapper;
use OCA\FilesReminders\Exception\NodeNotFoundException;
use OCA\FilesReminders\Exception\ReminderNotFoundException;
use OCA\FilesReminders\Exception\UserNotFoundException;
use OCA\FilesReminders\Model\RichReminder;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\Files\Folder;
Expand All @@ -28,6 +27,7 @@
use OCP\IUser;
use OCP\IUserManager;
use OCP\Notification\IManager as INotificationManager;
use OCP\User\Exceptions\UserNotFoundException;
use Psr\Log\LoggerInterface;
use Throwable;

Expand Down Expand Up @@ -165,7 +165,7 @@ public function send(Reminder $reminder): void {

$user = $this->userManager->get($reminder->getUserId());
if ($user === null) {
throw new UserNotFoundException();
throw UserNotFoundException::createForUser($reminder->getUserId());
}

$notification = $this->notificationManager->createNotification();
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/lib/External/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace OCA\Files_Sharing\External;

use OC\Files\Filesystem;
use OC\User\NoUserException;
use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
use OCA\Files_Sharing\Helper;
use OCP\AppFramework\Db\DoesNotExistException;
Expand All @@ -35,6 +34,7 @@
use OCP\Notification\IManager;
use OCP\OCS\IDiscoveryService;
use OCP\Share\IShare;
use OCP\User\Exceptions\UserNotFoundException;
use Psr\Log\LoggerInterface;

class Manager {
Expand Down Expand Up @@ -67,7 +67,7 @@ public function __construct(
*
* @throws Exception
* @throws NotPermittedException
* @throws NoUserException
* @throws UserNotFoundException
*/
public function addShare(ExternalShare $externalShare, IUser|IGroup|null $shareWith = null): ?Mount {
$shareWith = $shareWith ?? $this->user;
Expand Down
4 changes: 2 additions & 2 deletions apps/files_sharing/lib/OrphanHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace OCA\Files_Sharing;

use OC\User\NoUserException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\Config\IUserMountCache;
use OCP\Files\IRootFolder;
use OCP\IDBConnection;
use OCP\User\Exceptions\UserNotFoundException;

class OrphanHelper {
public function __construct(
Expand All @@ -25,7 +25,7 @@ public function __construct(
public function isShareValid(string $owner, int $fileId): bool {
try {
$userFolder = $this->rootFolder->getUserFolder($owner);
} catch (NoUserException $e) {
} catch (UserNotFoundException $e) {
return false;
}
$node = $userFolder->getFirstNodeById($fileId);
Expand Down
11 changes: 3 additions & 8 deletions apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use OC\Files\Storage\Wrapper\Wrapper;
use OC\Files\View;
use OC\Share\Share;
use OC\User\NoUserException;
use OCA\Files_Sharing\ISharedStorage as LegacyISharedStorage;
use OCP\Constants;
use OCP\Files\Cache\ICache;
Expand All @@ -43,6 +42,7 @@
use OCP\Server;
use OCP\Share\IManager as IShareManager;
use OCP\Share\IShare;
use OCP\User\Exceptions\UserNotFoundException;
use OCP\Util;
use Override;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -193,13 +193,8 @@ private function init() {
'mask' => $this->superShare->getPermissions(),
]);
}
} catch (NotFoundException $e) {
// original file not accessible or deleted, set FailedStorage
$this->storage = new FailedStorage(['exception' => $e]);
$this->cache = new FailedCache();
$this->rootPath = '';
} catch (NoUserException $e) {
// sharer user deleted, set FailedStorage
} catch (NotFoundException|UserNotFoundException $e) {
// original file not accessible or deleted or sharer user deleted, set FailedStorage
$this->storage = new FailedStorage(['exception' => $e]);
$this->cache = new FailedCache();
$this->rootPath = '';
Expand Down
4 changes: 2 additions & 2 deletions apps/files_trashbin/lib/Trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use OC\Files\Node\NonExistingFile;
use OC\Files\Node\NonExistingFolder;
use OC\Files\View;
use OC\User\NoUserException;
use OC_User;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\Files_Trashbin\Command\Expire;
Expand Down Expand Up @@ -53,6 +52,7 @@
use OCP\Lock\LockedException;
use OCP\Server;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\User\Exceptions\UserNotFoundException;
use OCP\Util;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
Expand Down Expand Up @@ -81,7 +81,7 @@ public static function ensureFileScannedHook(Node $node): void {
*
* @param string $filename
* @return array
* @throws NoUserException
* @throws UserNotFoundException
*/
public static function getUidAndFilename($filename) {
$uid = Filesystem::getOwner($filename);
Expand Down
6 changes: 3 additions & 3 deletions apps/files_versions/lib/Sabre/VersionHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

namespace OCA\Files_Versions\Sabre;

use OC\User\NoUserException;
use OCA\Files_Versions\Versions\IVersionManager;
use OCP\Files\IRootFolder;
use OCP\IUserManager;
use OCP\User\Exceptions\UserNotFoundException;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\ICollection;

Expand All @@ -27,8 +27,8 @@ public function __construct(
private function getUser() {
[, $name] = \Sabre\Uri\split($this->principalInfo['uri']);
$user = $this->userManager->get($name);
if (!$user) {
throw new NoUserException();
if ($user === null) {
throw UserNotFoundException::createForUser($name);
}
return $user;
}
Expand Down
4 changes: 3 additions & 1 deletion apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
use OCP\IUserManager;
use OCP\Lock\ILockingProvider;
use OCP\Server;
use OCP\User\Exceptions\UserNotFoundException;
use OCP\Util;
use Psr\Log\LoggerInterface;

Expand Down Expand Up @@ -90,7 +91,7 @@ class Storage {
*
* @param string $filename
* @return array
* @throws NoUserException
* @throws UserNotFoundException
*/
public static function getUidAndFilename($filename) {
$uid = Filesystem::getOwner($filename);
Expand Down Expand Up @@ -844,6 +845,7 @@ public static function scheduleExpire($uid, $fileName) {
* @param string $filename path to file to expire
* @param string $uid user for which to expire the version
* @return bool|int|null
* @throws UserNotFoundException
*/
public static function expire($filename, $uid) {
$expiration = self::getExpiration();
Expand Down
Loading
Loading