aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-11-06 12:50:16 +0100
committerMarcel Klehr <mklehr@gmx.net>2023-11-06 12:50:16 +0100
commitd11b9cbd7993042fcf9ba49d5c8ef14bf928d901 (patch)
tree4a62c0255c3a7efa90dae441afd6afbd1484020a /lib/public
parent181f819e417a1818f37200f9071fa632c82a0fc2 (diff)
downloadnextcloud-server-d11b9cbd7993042fcf9ba49d5c8ef14bf928d901.tar.gz
nextcloud-server-d11b9cbd7993042fcf9ba49d5c8ef14bf928d901.zip
fix(TextProcessing/Manager): Throw TaskFailureException upon failure
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/TextProcessing/Exception/TaskFailureException.php7
-rw-r--r--lib/public/TextProcessing/IManager.php5
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/public/TextProcessing/Exception/TaskFailureException.php b/lib/public/TextProcessing/Exception/TaskFailureException.php
new file mode 100644
index 00000000000..5f7b308757b
--- /dev/null
+++ b/lib/public/TextProcessing/Exception/TaskFailureException.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace OCP\TextProcessing\Exception;
+
+class TaskFailureException extends \RuntimeException {
+
+}
diff --git a/lib/public/TextProcessing/IManager.php b/lib/public/TextProcessing/IManager.php
index aae686e318c..ff1222b094d 100644
--- a/lib/public/TextProcessing/IManager.php
+++ b/lib/public/TextProcessing/IManager.php
@@ -29,6 +29,7 @@ namespace OCP\TextProcessing;
use OCP\Common\Exception\NotFoundException;
use OCP\DB\Exception;
use OCP\PreConditionNotMetException;
+use OCP\TextProcessing\Exception\TaskFailureException;
use RuntimeException;
/**
@@ -57,7 +58,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 running the task failed
* @since 27.1.0
*/
public function runTask(Task $task): string;
@@ -82,7 +83,7 @@ interface IManager {
* @param Task $task The task to schedule
* @returns bool A boolean indicating whether the task was run synchronously (`true`) or offloaded to a background job (`false`)
* @throws PreConditionNotMetException If no or not the requested provider was registered but this method was still called
- * @throws RuntimeException If running the task failed
+ * @throws TaskFailureException If running the task failed
* @throws Exception storing the task in the database failed
* @since 28.0.0
*/