aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-06-27 16:51:41 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-07-07 13:39:10 +0200
commitb00a9a6eaeeafce11e0141199f37d8a105050cce (patch)
treedc1e03741aa8c08e7522751b266f99205acfe009 /lib
parenta7cd6bf5b80d1974d8e680fd5da9b7f3af28ffa6 (diff)
downloadnextcloud-server-b00a9a6eaeeafce11e0141199f37d8a105050cce.tar.gz
nextcloud-server-b00a9a6eaeeafce11e0141199f37d8a105050cce.zip
LLM OCP API: Use OCP\Common\Exception\NotFoundException
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/LanguageModel/LanguageModelManager.php5
-rw-r--r--lib/public/LanguageModel/ILanguageModelManager.php3
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/LanguageModel/LanguageModelManager.php b/lib/private/LanguageModel/LanguageModelManager.php
index 340116e7d71..4a29e8d8b18 100644
--- a/lib/private/LanguageModel/LanguageModelManager.php
+++ b/lib/private/LanguageModel/LanguageModelManager.php
@@ -8,6 +8,7 @@ use OC\LanguageModel\Db\TaskMapper;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\BackgroundJob\IJobList;
+use OCP\Common\Exception\NotFoundException;
use OCP\DB\Exception;
use OCP\IServerContainer;
use OCP\LanguageModel\AbstractLanguageModelTask;
@@ -152,14 +153,14 @@ class LanguageModelManager implements ILanguageModelManager {
* @param int $id The id of the task
* @return ILanguageModelTask
* @throws RuntimeException If the query failed
- * @throws \ValueError If the task could not be found
+ * @throws NotFoundException If the task could not be found
*/
public function getTask(int $id): ILanguageModelTask {
try {
$taskEntity = $this->taskMapper->find($id);
return AbstractLanguageModelTask::fromTaskEntity($taskEntity);
} catch (DoesNotExistException $e) {
- throw new \ValueError('Could not find task with the provided id');
+ throw new NotFoundException('Could not find task with the provided id');
} catch (MultipleObjectsReturnedException $e) {
throw new RuntimeException('Could not uniquely identify task with given id');
} catch (Exception $e) {
diff --git a/lib/public/LanguageModel/ILanguageModelManager.php b/lib/public/LanguageModel/ILanguageModelManager.php
index 80546149a62..4c28ca86d72 100644
--- a/lib/public/LanguageModel/ILanguageModelManager.php
+++ b/lib/public/LanguageModel/ILanguageModelManager.php
@@ -26,6 +26,7 @@ declare(strict_types=1);
namespace OCP\LanguageModel;
+use OCP\Common\Exception\NotFoundException;
use OCP\PreConditionNotMetException;
use RuntimeException;
@@ -70,7 +71,7 @@ interface ILanguageModelManager {
* @param int $id The id of the task
* @return ILanguageModelTask
* @throws RuntimeException If the query failed
- * @throws \ValueError If the task could not be found
+ * @throws NotFoundException If the task could not be found
* @since 28.0.0
*/
public function getTask(int $id): ILanguageModelTask;