Skip to content

fix: user sending the wrong command is not an error#8270

Merged
khendrikse merged 1 commit into
mainfrom
kh/wrong-command-is-not-an-error
May 21, 2026
Merged

fix: user sending the wrong command is not an error#8270
khendrikse merged 1 commit into
mainfrom
kh/wrong-command-is-not-an-error

Conversation

@khendrikse
Copy link
Copy Markdown
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Right now we throw an error if the user is using a wrong command on the CLI. Not only does this give a lot of noise in our monitoring, it is also not necessary.

This changes the logic to only log and exit, and also to filter out these kind of messages from the error logging (for old versions still doing this)

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@khendrikse khendrikse requested review from a team as code owners May 21, 2026 13:50
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0470bcfa-8fb5-4bd5-95b6-cab9309a06ff

📥 Commits

Reviewing files that changed from the base of the PR and between a3549b8 and 89874e9.

📒 Files selected for processing (2)
  • site/netlify/functions/error-reporting.ts
  • src/commands/main.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error message filtering to prevent unnecessary notifications for certain error scenarios.
    • Modified CLI error handling behavior in non-interactive environments for more consistent error responses.

Walkthrough

This PR refines error handling for non-interactive CLI command suggestions. It adds a new error message pattern ('for a list of available commands') to the Bugsnag error classifier so matching messages are treated as user input errors and filtered from error reporting. Simultaneously, the CLI's handling of rejected command suggestions in non-interactive environments changes from throwing errors to printing an error message and exiting with code 1, which aligns with the new pattern classification.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: preventing user input errors (wrong command) from being treated as system errors. It directly relates to the core change across both modified files.
Description check ✅ Passed The description clearly explains the problem (error monitoring noise from wrong user commands) and the solution (log and exit instead of throwing errors, plus filtering old error messages). It is directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kh/wrong-command-is-not-an-error

Warning

Review ran into problems

🔥 Problems

Linked repositories: Couldn't analyze netlify/cli - clone failed: Clone operation failed: Stream initialization permanently failed: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

📊 Benchmark results

Comparing with a3549b8

  • Dependency count: 1,134 (no change)
  • Package size: 379 MB ⬆️ 0.00% increase vs. a3549b8
  • Number of ts-expect-error directives: 355 (no change)

@khendrikse khendrikse merged commit 21fe038 into main May 21, 2026
40 checks passed
@khendrikse khendrikse deleted the kh/wrong-command-is-not-an-error branch May 21, 2026 15:32
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