Simplify Ollama error messages
Signed-off-by: Fred Bricon <fbricon@gmail.com>
This commit is contained in:
parent
4b45666262
commit
66f53debf1
2 changed files with 4 additions and 4 deletions
|
|
@ -416,8 +416,8 @@ export abstract class BaseLLM implements ILLM {
|
|||
e.message.includes("http://127.0.0.1:11434")
|
||||
) {
|
||||
const message = (await isOllamaInstalled()) ?
|
||||
"Failed to connect to local Ollama instance. Ollama appears to be stopped. It needs to be running." :
|
||||
"Failed to connect to local Ollama instance, please ensure Ollama is both installed and running. You can download Ollama from https://ollama.ai."
|
||||
"Unable to connect to local Ollama instance. Ollama may not be running." :
|
||||
"Unable to connect to local Ollama instance. Ollama may not be installed or may not running."
|
||||
;
|
||||
throw new Error(message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ export class ContinueCompletionProvider
|
|||
{
|
||||
private onError(e: any) {
|
||||
const options = ["Documentation"];
|
||||
if (e.message.includes("https://ollama.ai")) {
|
||||
if (e.message.includes("Ollama may not be installed")) {
|
||||
options.push("Download Ollama");
|
||||
} else if (e.message.includes("Ollama appears to be stopped")) {
|
||||
} else if (e.message.includes("Ollama may not be running")) {
|
||||
options.unshift("Start Ollama"); // We want "Start" to be the default choice
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue