Skip to content

Remove unused code parameter from describePreviewError#3970

Open
kridaydave wants to merge 2 commits into
pingdotgg:mainfrom
kridaydave:fix/preview-errorcode-remove-unused-param
Open

Remove unused code parameter from describePreviewError#3970
kridaydave wants to merge 2 commits into
pingdotgg:mainfrom
kridaydave:fix/preview-errorcode-remove-unused-param

Conversation

@kridaydave

@kridaydave kridaydave commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

describePreviewError took a code argument that was never used because lookups key on the description string. Dropped the parameter, updated the only caller in PreviewUnreachable, and added a unit test covering the mapped, unknown, and empty-description cases.


Note

Low Risk
Small API cleanup in preview error copy with one call site; only user-visible change is dropping the code from the empty-description fallback string.

Overview
Removes the unused numeric code argument from describePreviewError, since friendly labels are keyed only on the Chromium description string. PreviewUnreachable now passes description alone.

When description is empty, the fallback user-facing text changes from Network error (${code}) to Network error. Numeric codes still appear in the UI via errorLabel when description is empty.

Adds errorCodeMessages.test.ts for known error mapping, unknown passthrough, and the empty-description fallback.

Reviewed by Cursor Bugbot for commit fcbc174. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Remove unused code parameter from describePreviewError

Removes the numeric code argument from describePreviewError in errorCodeMessages.ts and updates the call site in PreviewUnreachable.tsx to match. The fallback message for an empty description changes from 'Network error (code)' to 'Network error'. Unit tests covering known Chromium error mapping, unknown description passthrough, and the empty fallback are added in errorCodeMessages.test.ts.

Macroscope summarized fcbc174.

describePreviewError took a code argument that was never used because lookups key on the description string. Dropped the parameter, updated the only caller in PreviewUnreachable, and added a unit test covering the mapped, unknown, and empty-description cases.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: faee85d6-1e33-4738-b005-28c47f2946bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jul 14, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Removes an unused code parameter from describePreviewError and adds unit tests. The only behavioral change is a minor simplification of a fallback error message. Low-risk cleanup.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant