Skip to content

Conversation

ri7116
Copy link
Contributor

@ri7116 ri7116 commented Sep 16, 2025

Catch ENOENT from rawMethods.cwd() and rethrow as ERR_SYSTEM_ERROR with context { syscall: 'process.cwd', code: 'ENOENT' }, preserving the original error in cause. This surfaces a clearer, actionable message when the current working directory has been deleted or unmounted and improves the stack (process.cwd instead of wrappedCwd).

Fixes: #57045

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Sep 16, 2025
Catch ENOENT from rawMethods.cwd() and rethrow as ERR_SYSTEM_ERROR
with context { syscall: 'process.cwd' code: 'ENOENT' },
preserving the original error in cause.
This surfaces a clearer, actionable message when the current
working directory has been deleted or unmounted and improves
the stack (process.cwd instead of wrappedCwd).

Fixes: nodejs#57045
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.29%. Comparing base (f1a8f44) to head (9e8e799).

Files with missing lines Patch % Lines
...ernal/bootstrap/switches/does_own_process_state.js 92.30% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #59902   +/-   ##
=======================================
  Coverage   88.28%   88.29%           
=======================================
  Files         702      702           
  Lines      206904   206921   +17     
  Branches    39808    39810    +2     
=======================================
+ Hits       182665   182694   +29     
+ Misses      16256    16219   -37     
- Partials     7983     8008   +25     
Files with missing lines Coverage Δ
...ernal/bootstrap/switches/does_own_process_state.js 94.40% <92.30%> (-0.73%) ⬇️

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

process.cwd() fails in a not usefully descriptive way
2 participants