fix: handle EEXIST error in build script#4
Conversation
Bun's mkdirSync throws EEXIST when the directory already exists, unlike Node.js which ignores it. Add try-catch to handle this case. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between e12181548ebdab91617ede8f5d25c64aff2cd4ab and 02f27c3. 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe build script now wraps directory creation in a try/catch block to gracefully handle cases where the directory already exists (EEXIST), allowing the build to continue while re-throwing other errors. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/build.ts`:
- Around line 122-126: The catch is too broad in the mkdirSync(dirname(outfile),
{ recursive: true }) call and currently swallows all errors; change the catch to
capture the error (e.g., catch (err)) and rethrow unless err.code === 'EEXIST'
so only the "directory exists" error is ignored; reference the mkdirSync call,
dirname(outfile), and its catch block when making this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e, Chinese prompts P0 freecodexyz#1: /cd command — switch working directory without exiting session P0 freecodexyz#2: --safe-mode flag — disable write/execute tools for troubleshooting P0 freecodexyz#3: Parallel tool call resilience — Bash errors no longer cancel siblings P0 freecodexyz#4: Auto mode classifier prompts — bilingual Chinese/English support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bun's mkdirSync throws EEXIST when the directory already exists, unlike Node.js which ignores it. Add try-catch to handle this case.
Summary by CodeRabbit