From b00a9a6eaeeafce11e0141199f37d8a105050cce Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 27 Jun 2023 16:51:41 +0200 Subject: LLM OCP API: Use OCP\Common\Exception\NotFoundException Signed-off-by: Marcel Klehr --- core/Controller/LanguageModelApiController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') 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); -- cgit v1.2.3