And use this new exception everywhere outside of where the old one was throw. Signed-off-by: Carl Schwan <carlschwan@kde.org>pull/61544/head
parent
fc52f6f66a
commit
da0928827a
@ -1,15 +0,0 @@ |
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
|
||||
/** |
||||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors |
||||
* SPDX-License-Identifier: AGPL-3.0-or-later |
||||
*/ |
||||
|
||||
namespace OCA\FilesReminders\Exception; |
||||
|
||||
use Exception; |
||||
|
||||
class UserNotFoundException extends Exception { |
||||
} |
||||
@ -0,0 +1,31 @@ |
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
|
||||
/** |
||||
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors |
||||
* SPDX-License-Identifier: AGPL-3.0-or-later |
||||
*/ |
||||
|
||||
namespace OCP\User\Exceptions; |
||||
|
||||
use OCP\AppFramework\Attribute\Catchable; |
||||
use OCP\AppFramework\Attribute\Throwable; |
||||
|
||||
/** |
||||
* The class UserNotFoundException is thrown when no user is found. |
||||
* |
||||
* @since 35.0.0 |
||||
*/ |
||||
#[Throwable(since: '35.0.0')] |
||||
#[Catchable(since: '35.0.0')] |
||||
class UserNotFoundException extends \Exception { |
||||
/** |
||||
* Return a UserNotFoundException with a standard error message. |
||||
* |
||||
* @since 35.0.0 |
||||
*/ |
||||
public static function createForUser(string $userId, ?\Exception $previous = null): self { |
||||
return new UserNotFoundException('User with ' . $userId . ' not found.', previous: $previous); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue