Skip to content

Commit

Permalink
LLM OCP API: Don't lose trace of wrapped exceptions
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Jul 7, 2023
1 parent 9455227 commit 05fcf31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/private/LanguageModel/LanguageModelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down Expand Up @@ -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);
}
}
}

0 comments on commit 05fcf31

Please sign in to comment.