fix(cli): list available languages on --lang mismatch; fix telemetry truncation #24

Merged
starkSV merged 1 commit from feat/cli-error-messages into main 2026-07-12 18:14:27 +05:30
starkSV commented 2026-07-12 18:14:16 +05:30 (Migrated from github.com)

Summary

  • --lang mismatch error now lists the languages actually available for that product, instead of just failing blind
  • --help text now notes language names vary by product (many consumer builds use English International, not English (United States) -- the exact --help example)
  • truncateError now keeps both head and tail of long error strings; previously kept only the head, which cut off the actual root cause for errors wrapping a long URL

Why

  • Production telemetry showed 11 --lang mismatch failures, mostly English (United States) against products that only offer English International -- exactly the --help example leading users astray

Test plan

  • cli tests pass
  • Verified live against product 3113: error now lists all available languages
  • Verified truncation output for both a long language-list error and a wrapped network error -- both preserve the useful parts

Summary by CodeRabbit

  • Bug Fixes

    • Improved error reporting by preserving both the beginning and end of long error messages.
    • Added available language names to errors when a requested language isn’t supported.
  • Documentation

    • Updated CLI help text with guidance on language naming and where to find supported language options.
## Summary - --lang mismatch error now lists the languages actually available for that product, instead of just failing blind - --help text now notes language names vary by product (many consumer builds use English International, not English (United States) -- the exact --help example) - truncateError now keeps both head and tail of long error strings; previously kept only the head, which cut off the actual root cause for errors wrapping a long URL ## Why - Production telemetry showed 11 --lang mismatch failures, mostly English (United States) against products that only offer English International -- exactly the --help example leading users astray ## Test plan - cli tests pass - Verified live against product 3113: error now lists all available languages - Verified truncation output for both a long language-list error and a wrapped network error -- both preserve the useful parts <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved error reporting by preserving both the beginning and end of long error messages. * Added available language names to errors when a requested language isn’t supported. * **Documentation** * Updated CLI help text with guidance on language naming and where to find supported language options. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2026-07-12 18:14:38 +05:30 (Migrated from github.com)

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5647df86-8a7a-4a42-a0cf-5ba9482e1812

📥 Commits

Reviewing files that changed from the base of the PR and between 48a6cb5eb4 and 61a296b92b.

📒 Files selected for processing (1)
  • cli/main.go

📝 Walkthrough

Walkthrough

The CLI now preserves both ends of long telemetry errors, adds language-selection guidance to usage text, and reports available languages when a requested language is unavailable.

Changes

CLI error and language handling

Layer / File(s) Summary
Language selection guidance and feedback
cli/main.go
Usage text explains product-specific language naming, while unavailable-language errors include a comma-separated list of available languages.
Head-and-tail error truncation
cli/main.go
Long telemetry error strings retain fixed-length prefix and suffix content separated by " ... ".

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

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 feat/cli-error-messages

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/starkSV/windows-iso-downloader/pull/24?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- This is an auto-generated comment: failure by coderabbit.ai --> > [!CAUTION] > ## Review failed > > The pull request is closed. <!-- end of auto-generated comment: failure by coderabbit.ai --> <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: defaults **Review profile**: CHILL **Plan**: Pro Plus **Run ID**: `5647df86-8a7a-4a42-a0cf-5ba9482e1812` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 48a6cb5eb476e90629f802e57f5b9271c2197e07 and 61a296b92bf43638938f2f47bb20757c96fb5198. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `cli/main.go` </details> </details> --- <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough The CLI now preserves both ends of long telemetry errors, adds language-selection guidance to usage text, and reports available languages when a requested language is unavailable. ### Changes **CLI error and language handling** |Layer / File(s)|Summary| |---|---| |**Language selection guidance and feedback** <br> `cli/main.go`|Usage text explains product-specific language naming, while unavailable-language errors include a comma-separated list of available languages.| |**Head-and-tail error truncation** <br> `cli/main.go`|Long telemetry error strings retain fixed-length prefix and suffix content separated by `" ... "`.| **Estimated code review effort:** 2 (Simple) | ~10 minutes **Possibly related PRs** - [starkSV/windows-iso-downloader#21](https://github.com/starkSV/windows-iso-downloader/pull/21): Updates `cli/main.go` with related 150-character error truncation for telemetry. </details> <!-- walkthrough_end --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing Touches</summary> <details> <summary>📝 Generate docstrings</summary> - [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> Create stacked PR - [ ] <!-- {"checkboxId": "3e1879ae-f29b-4d0d-8e06-d12b7ba33d98"} --> Commit on current branch </details> <details> <summary>🧪 Generate unit tests (beta)</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `feat/cli-error-messages` </details> </details> <!-- finishing_touch_checkbox_end --> <!-- This is an auto-generated comment: all tool run failures by coderabbit.ai --> > [!WARNING] > There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. > > <details> > <summary>🔧 golangci-lint (2.12.2)</summary> > > level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" > > > > > </details> <!-- end of auto-generated comment: all tool run failures by coderabbit.ai --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=starkSV/windows-iso-downloader&utm_content=24)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: shekhar/windows-iso-downloader#24
No description provided.