Skip to content

Commit 9826b08

Browse files
authored
fix: catch the expired creds exception and throw it using the method in utils (#388)
1 parent 70e3078 commit 9826b08

File tree

1 file changed

+7
-0
lines changed
  • src/bedrock_agentcore_starter_toolkit/cli/evaluation

1 file changed

+7
-0
lines changed

src/bedrock_agentcore_starter_toolkit/cli/evaluation/commands.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
save_json_output,
2020
)
2121
from ...operations.evaluation.on_demand_processor import EvaluationProcessor
22+
from ...utils.aws import ensure_valid_aws_creds
2223
from ...utils.runtime.config import load_config_if_exists
2324
from ..common import console
2425

@@ -232,6 +233,12 @@ def list_evaluators(
232233
# List more evaluators
233234
agentcore eval evaluator list --max-results 100
234235
"""
236+
# Validate AWS credentials
237+
valid, error_msg = ensure_valid_aws_creds()
238+
if not valid:
239+
console.print(f"[red]Error:[/red] {error_msg}")
240+
raise typer.Exit(1)
241+
235242
try:
236243
# Get region and client
237244
agent_config = _get_agent_config_from_file()

0 commit comments

Comments
 (0)