summaryrefslogtreecommitdiffstats
path: root/core
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 /core
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 'core')
-rw-r--r--core/Controller/LanguageModelApiController.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/Controller/LanguageModelApiController.php b/core/Controller/LanguageModelApiController.php
index 5699dd75526..a4f83cc1b11 100644
--- a/core/Controller/LanguageModelApiController.php
+++ b/core/Controller/LanguageModelApiController.php
@@ -29,6 +29,7 @@ namespace OC\Core\Controller;
use InvalidArgumentException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
+use OCP\Common\Exception\NotFoundException;
use OCP\IL10N;
use OCP\IRequest;
use OCP\LanguageModel\AbstractLanguageModelTask;
@@ -87,7 +88,7 @@ class LanguageModelApiController extends \OCP\AppFramework\OCSController {
return new DataResponse([
'task' => $task,
]);
- } catch (\ValueError $e) {
+ } catch (NotFoundException $e) {
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);
} catch (\RuntimeException $e) {
return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR);