Skip to content

refactor: improve error message for unknown --env value#168

Merged
angeloashmore merged 5 commits intomainfrom
refactor/invalid-environment-error
May 1, 2026
Merged

refactor: improve error message for unknown --env value#168
angeloashmore merged 5 commits intomainfrom
refactor/invalid-environment-error

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented May 1, 2026

Resolves:

Description

Improves the error shown when --env is passed an unknown environment. The message is now formatted consistently with the CLI's other errors and lists the available environments (or notes when none exist).

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

angeloashmore and others added 2 commits May 1, 2026 21:07
Centralize the "environment not found" error message in the top-level
error handler instead of throwing CommandError from resolveEnvironment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore marked this pull request as ready for review May 1, 2026 21:12
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4bcaa00. Configure here.

Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
angeloashmore and others added 3 commits May 1, 2026 21:19
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore changed the title refactor: throw InvalidEnvironmentError for unknown env refactor: improve error message for unknown --env value May 1, 2026
@angeloashmore angeloashmore merged commit 4b8d249 into main May 1, 2026
13 checks passed
@angeloashmore angeloashmore deleted the refactor/invalid-environment-error branch May 1, 2026 22:12
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.

1 participant