Skip to content

Commit 8880e06

Browse files
committed
fix(beeai-cli): properly display error messages
Signed-off-by: Jan Pokorný <JenomPokorny@gmail.com>
1 parent bd66147 commit 8880e06

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

  • apps/beeai-cli/src/beeai_cli/commands

apps/beeai-cli/src/beeai_cli/commands/env.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from rich.table import Column
2020

2121
from beeai_cli.api import api_request
22-
from beeai_cli.async_typer import AsyncTyper, console, create_table, err_console
22+
from beeai_cli.async_typer import AsyncTyper, console, create_table
2323
from beeai_cli.configuration import Configuration
2424
from beeai_cli.utils import format_error, parse_env_var, run_command, verbosity
2525

@@ -387,7 +387,7 @@ async def setup(
387387
)
388388
response_text = test_response.json().get("choices", [{}])[0].get("message", {}).get("content", "")
389389
if "Hello" not in response_text:
390-
err_console.print(format_error("Error", "Model did not provide a proper response."))
390+
console.print(format_error("Error", "Model did not provide a proper response."))
391391
return False
392392

393393
selected_embedding_model = None
@@ -442,7 +442,7 @@ async def setup(
442442
return False
443443

444444
except Exception as e:
445-
err_console.print(format_error("Error", f"Error during model test: {e!s}"))
445+
console.print(format_error("Error", f"Error during model test: {e!s}"))
446446
return False
447447

448448
if not use_true_localhost:
@@ -489,10 +489,8 @@ async def ensure_llm_env():
489489
console.print("[bold]Welcome to 🐝 [red]BeeAI[/red]![/bold]")
490490
console.print("Let's start by configuring your LLM environment.\n")
491491
if not await setup():
492-
err_console.print(
493-
format_error("Error", "Could not continue because the LLM environment is not properly set up.")
494-
)
495-
err_console.print(
492+
console.print(format_error("Error", "Could not continue because the LLM environment is not properly set up."))
493+
console.print(
496494
"💡 [yellow]HINT[/yellow]: Try re-entering your LLM API details with: [green]beeai env setup[/green]"
497495
)
498496
sys.exit(1)

0 commit comments

Comments
 (0)