diff --git a/lib/private/LanguageModel/LanguageModelManager.php b/lib/private/LanguageModel/LanguageModelManager.php index c6f1a17229440..c195669acb433 100644 --- a/lib/private/LanguageModel/LanguageModelManager.php +++ b/lib/private/LanguageModel/LanguageModelManager.php @@ -168,11 +168,11 @@ public function runTask(ILanguageModelTask $task): string { $this->logger->info('LanguageModel call using provider ' . $provider->getName() . ' failed', ['exception' => $e]); $task->setStatus(ILanguageModelTask::STATUS_FAILED); $this->taskMapper->update(Task::fromLanguageModelTask($task)); - throw new RuntimeException('LanguageModel call using provider ' . $provider->getName() . ' failed: ' . $e->getMessage()); + throw new RuntimeException('LanguageModel call using provider ' . $provider->getName() . ' failed: ' . $e->getMessage(), 0, $e); } } - throw new RuntimeException('Could not transcribe file'); + throw new RuntimeException('Could not run task'); } /** @@ -205,9 +205,9 @@ public function getTask(int $id): ILanguageModelTask { } catch (DoesNotExistException $e) { 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'); + throw new RuntimeException('Could not uniquely identify task with given id', 0, $e); } catch (Exception $e) { - throw new RuntimeException('Failure while trying to find task by id: '.$e->getMessage()); + throw new RuntimeException('Failure while trying to find task by id: '.$e->getMessage(), 0, $e); } } }