diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-10-26 11:16:15 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-10-26 11:16:15 +0200 |
commit | 47e13cd55b3e369629b8b15a9332f50102ac076c (patch) | |
tree | e39e93345d5fca54c4a12dd3c17c57ebf6101b0c /lib/public | |
parent | 8339b5b12857b2fc3a25b289cb063a90499d0da3 (diff) | |
download | nextcloud-server-47e13cd55b3e369629b8b15a9332f50102ac076c.tar.gz nextcloud-server-47e13cd55b3e369629b8b15a9332f50102ac076c.zip |
en(TextToImage): Use specific exception class instead of generic RuntimeException
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/TextToImage/Exception/TaskFailureException.php | 31 | ||||
-rw-r--r-- | lib/public/TextToImage/IManager.php | 5 |
2 files changed, 34 insertions, 2 deletions
diff --git a/lib/public/TextToImage/Exception/TaskFailureException.php b/lib/public/TextToImage/Exception/TaskFailureException.php new file mode 100644 index 00000000000..a640fdff2e8 --- /dev/null +++ b/lib/public/TextToImage/Exception/TaskFailureException.php @@ -0,0 +1,31 @@ +<?php + +/** + * @copyright Copyright (c) 2023 Marcel Klehr <mklehr@gmx.net> + * + * @author Marcel Klehr <mklehr@gmx.net> + * + * @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\TextToImage\Exception; + +/** + * @since 28.0.0 + */ +class TaskFailureException extends TextToImageException { +} diff --git a/lib/public/TextToImage/IManager.php b/lib/public/TextToImage/IManager.php index cfe38e3ce7f..bc16896b43b 100644 --- a/lib/public/TextToImage/IManager.php +++ b/lib/public/TextToImage/IManager.php @@ -28,6 +28,7 @@ namespace OCP\TextToImage; use OCP\DB\Exception; use OCP\PreConditionNotMetException; +use OCP\TextToImage\Exception\TaskFailureException; use OCP\TextToImage\Exception\TaskNotFoundException; use RuntimeException; @@ -51,7 +52,7 @@ interface IManager { /** * @param Task $task The task to run * @throws PreConditionNotMetException If no or not the requested provider was registered but this method was still called - * @throws RuntimeException If something else failed + * @throws TaskFailureException If something else failed * @since 28.0.0 */ public function runTask(Task $task): void; @@ -71,7 +72,7 @@ interface IManager { /** * @throws Exception if there was a problem inserting the task into the database * @throws PreConditionNotMetException if no provider is registered - * @throws RuntimeException If the task run fail + * @throws TaskFailureException If the task run failed * @since 28.0.0 */ public function runOrScheduleTask(Task $task) : void; |