diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-06 15:45:28 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-06 22:26:58 +0100 |
commit | 3ddc68f91b61641e6273a7d17b659188fe4ecd16 (patch) | |
tree | 87916eb8086b665a834d26f190fe7d57fa73ab8f /lib/public/AppFramework | |
parent | bc35bf14f08f6b91065377d4741762ccfba63814 (diff) | |
download | nextcloud-server-3ddc68f91b61641e6273a7d17b659188fe4ecd16.tar.gz nextcloud-server-3ddc68f91b61641e6273a7d17b659188fe4ecd16.zip |
Add IMapperException
This way code using the DB mappers can have try catch blocks on this
type of exceptions if they do not care if there was non or to many.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/public/AppFramework')
-rw-r--r-- | lib/public/AppFramework/Db/DoesNotExistException.php | 3 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/IMapperException.php | 30 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/MultipleObjectsReturnedException.php | 3 |
3 files changed, 34 insertions, 2 deletions
diff --git a/lib/public/AppFramework/Db/DoesNotExistException.php b/lib/public/AppFramework/Db/DoesNotExistException.php index b8adc36c7ba..9823a0a1fa8 100644 --- a/lib/public/AppFramework/Db/DoesNotExistException.php +++ b/lib/public/AppFramework/Db/DoesNotExistException.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -30,7 +31,7 @@ namespace OCP\AppFramework\Db; * entry in the database * @since 7.0.0 */ -class DoesNotExistException extends \Exception { +class DoesNotExistException extends \Exception implements IMapperException { /** * Constructor diff --git a/lib/public/AppFramework/Db/IMapperException.php b/lib/public/AppFramework/Db/IMapperException.php new file mode 100644 index 00000000000..dbb9883ae88 --- /dev/null +++ b/lib/public/AppFramework/Db/IMapperException.php @@ -0,0 +1,30 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2018, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\AppFramework\Db; + +/** + * @since 16.0.0 + */ +interface IMapperException {} diff --git a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php index a17d95e0ef1..3955c417d57 100644 --- a/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php +++ b/lib/public/AppFramework/Db/MultipleObjectsReturnedException.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -30,7 +31,7 @@ namespace OCP\AppFramework\Db; * row * @since 7.0.0 */ -class MultipleObjectsReturnedException extends \Exception { +class MultipleObjectsReturnedException extends \Exception implements IMapperException { /** * Constructor |