Skip to content

Commit dac2e96

Browse files
fixup! fixup! feat(integration): Use LLM to fill event details
Signed-off-by: Christoph Wurst <[email protected]>
1 parent cf49210 commit dac2e96

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Service/AiIntegrations/AiIntegrationsService.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use OCP\TextProcessing\IManager;
3737
use OCP\TextProcessing\SummaryTaskType;
3838
use OCP\TextProcessing\Task;
39+
use Psr\Container\ContainerExceptionInterface;
3940
use Psr\Container\ContainerInterface;
4041
use Psr\Container\NotFoundExceptionInterface;
4142
use function array_map;
@@ -129,7 +130,7 @@ public function generateEventData(Account $account, Mailbox $mailbox, string $th
129130
try {
130131
/** @var IManager $manager */
131132
$manager = $this->container->get(IManager::class);
132-
} catch (NotFoundExceptionInterface $e) {
133+
} catch (ContainerExceptionInterface $e) {
133134
return null;
134135
}
135136
if (!in_array(FreePromptTaskType::class, $manager->getAvailableTaskTypes(), true)) {

tests/Unit/Service/AiIntegrationsServiceTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use OCA\Mail\Model\IMAPMessage;
3838
use OCA\Mail\Service\AiIntegrations\AiIntegrationsService;
3939
use OCA\Mail\Service\AiIntegrations\Cache;
40+
use OCP\AppFramework\QueryException;
4041
use OCP\TextProcessing\FreePromptTaskType;
4142
use OCP\TextProcessing\IManager;
4243
use OCP\TextProcessing\SummaryTaskType;
@@ -243,7 +244,7 @@ public function testGenerateEventDataLlmUnavailable(): void {
243244
$message2 = new Message();
244245
$this->container->expects(self::once())
245246
->method('get')
246-
->willThrowException($this->createMock(NotFoundExceptionInterface::class));
247+
->willThrowException($this->createMock(QueryException::class));
247248

248249
$result = $this->aiIntegrationsService->generateEventData(
249250
$account,

0 commit comments

Comments
 (0)