Skip to content

Route root-callback env errors through the standard error path#35

Merged
alexkroman merged 2 commits into
mainfrom
claude/error-handling-improvements-VCya1
Jun 7, 2026
Merged

Route root-callback env errors through the standard error path#35
alexkroman merged 2 commits into
mainfrom
claude/error-handling-improvements-VCya1

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

The root @app.callback() was the one place that emitted a CLIError by hand
(typer.echo(err.message)), so an unknown --env / AAI_ENV / stored-profile env
was the only user-facing error that ignored --json, dropped the Error:/Suggestion:
formatting, and gave no recovery hint.

  • environments.get() now attaches a suggestion covering all three sources of the
    bad name (flag, AAI_ENV, profile).
  • main() emits the error via output.emit_error (auto-detecting JSON when piped/
    agentic) and styles the env-override warning via output.warn, matching every
    other command path.

https://claude.ai/code/session_01QdhBPbDcDgoTnefyTzZK2W

claude and others added 2 commits June 7, 2026 23:22
The root @app.callback() was the one place that emitted a CLIError by hand
(typer.echo(err.message)), so an unknown --env / AAI_ENV / stored-profile env
was the only user-facing error that ignored --json, dropped the Error:/Suggestion:
formatting, and gave no recovery hint.

- environments.get() now attaches a suggestion covering all three sources of the
  bad name (flag, AAI_ENV, profile).
- main() emits the error via output.emit_error (auto-detecting JSON when piped/
  agentic) and styles the env-override warning via output.warn, matching every
  other command path.

https://claude.ai/code/session_01QdhBPbDcDgoTnefyTzZK2W
@alexkroman alexkroman merged commit 854d928 into main Jun 7, 2026
10 checks passed
@alexkroman alexkroman deleted the claude/error-handling-improvements-VCya1 branch June 7, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants