Remove unused code parameter from describePreviewError#3970
Conversation
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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Approved Removes an unused You can customize Macroscope's approvability policy. Learn more. |
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
codeargument fromdescribePreviewError, since friendly labels are keyed only on the Chromiumdescriptionstring.PreviewUnreachablenow passesdescriptionalone.When
descriptionis empty, the fallback user-facing text changes fromNetwork error (${code})toNetwork error. Numeric codes still appear in the UI viaerrorLabelwhen description is empty.Adds
errorCodeMessages.test.tsfor 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
codeparameter fromdescribePreviewErrorRemoves the numeric
codeargument fromdescribePreviewErrorin 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.