Skip to content

style: rename catch (err|error) identifiers to catch (e)#1264

Open
John-David Dalton (jdalton) wants to merge 2 commits intomainfrom
chore/rename-catch-identifiers
Open

style: rename catch (err|error) identifiers to catch (e)#1264
John-David Dalton (jdalton) wants to merge 2 commits intomainfrom
chore/rename-catch-identifiers

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton John-David Dalton (jdalton) commented Apr 22, 2026

Summary

Mechanical rename across 11 files to match the CLAUDE.md `catch (e)` convention. 12 catch clauses converted. Body references renamed (including inside template literal interpolations); property keys and member-access expressions (`logger.error`, `console.error`) are left untouched.

Test plan

  • `tsgo --noEmit` clean (already verified locally).
  • CI green.

Note

Low Risk
Mechanical rename of catch binding identifiers and corresponding references in CLI scripts/utilities; no control-flow or behavioral changes expected beyond error logging variable names.

Overview
Standardizes error-handling style across CLI scripts and a couple runtime modules by renaming catch (error|err) bindings to catch (e) and updating all *.message/stack/log references accordingly.

Also adjusts one returned error object in download-assets.mts to keep the key error while storing the caught value ({ error: e, ... }).

Reviewed by Cursor Bugbot for commit 9c80133. Configure here.

Mechanical rename across 11 files to match the CLAUDE.md
catch-binding convention. 12 catch clauses converted; body
references renamed including inside template literal interpolations.
Property keys and member-access expressions (logger.error,
console.error) are left untouched.

tsgo --noEmit clean post-sweep.
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 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Object property key accidentally renamed from error to e
    • Changed { e, name, ok: false } to { error: e, name, ok: false } to preserve the original error property key after the catch variable was renamed from error to e.

Create PR

Or push these changes by commenting:

@cursor push 4cddc6bbcb
Preview (4cddc6bbcb)
diff --git a/packages/cli/scripts/download-assets.mts b/packages/cli/scripts/download-assets.mts
--- a/packages/cli/scripts/download-assets.mts
+++ b/packages/cli/scripts/download-assets.mts
@@ -129,7 +129,7 @@
     logger.groupEnd()
     logger.error(`Failed to extract ${name}: ${e.message}`)
     await logTransientErrorHelp(e)
-    return { e, name, ok: false }
+    return { error: e, name, ok: false }
   }
 }

You can send follow-ups to the cloud agent here.

Comment thread packages/cli/scripts/download-assets.mts Outdated
The catch-variable rename script converted shorthand `{ error, name,
ok: false }` to `{ e, name, ok: false }`, which silently changed
the return-object shape — a real consumer-facing regression even
though no callers currently read `.error`. Spell it out as
`{ error: e, name, ok: false }` to keep the shape identical to
the pre-rename version.
@jdalton
Copy link
Copy Markdown
Contributor Author

bugbot run

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9c80133. Configure here.

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