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-08-09 10:01:02 +0200
commitfb9262e8644e68f6cb4df9be95f0306ab5f43672 (patch)
treefda04720502aebdc894f048c00b2bb9e4b0e2c00 /core
parentd203e3ad8db168c705dfee9b6bc46e0ff9c12d34 (diff)
downloadnextcloud-server-fb9262e8644e68f6cb4df9be95f0306ab5f43672.tar.gz
nextcloud-server-fb9262e8644e68f6cb4df9be95f0306ab5f43672.zip
LLM OCP API: Use OCP\Common\Exception\NotFoundException
Signed-off-by: Marcel Klehr <mklehr@gmx.net> (cherry picked from commit b00a9a6eaeeafce11e0141199f37d8a105050cce)
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);