-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
fix(process): improve error message for process.cwd() when directory is deleted #57184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@jasnell can you check this i have done some thing that caused deletion of repo can you now check the pr |
Are there more changes to make |
@aduh95 can you check for further process to approve |
Any reason you're not taking any of my suggestions? It's certainly fine if you disagree with those, but please at least comment on each explaining why |
Ohh sorry I think I made the changes but did not commit |
Co-authored-by: Antoine du Hamel <[email protected]>
Co-authored-by: Antoine du Hamel <[email protected]>
Co-authored-by: Antoine du Hamel <[email protected]>
@aduh95 i have made changes according to your suggesations |
removing extra space
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #57184 +/- ##
=======================================
Coverage 90.15% 90.15%
=======================================
Files 630 630
Lines 186756 186759 +3
Branches 36648 36651 +3
=======================================
+ Hits 168362 168370 +8
- Misses 11193 11201 +8
+ Partials 7201 7188 -13
🚀 New features to boost your workflow:
|
can anyone tell me what should i do now |
@Ankush1oo8 As you can see, GH does point at failures in another test that are definitely related to this change – the exit code is now different in at least one case ( |
Can you check now |
@addaleax I don't know what to doi have tried to solve it but did not get any clue |
i have tried to change the code in test-cwd-enoent-preload.js |
There are lint errors to address |
what should i do about first commit message @aduh95 can help please |
Hey @Ankush1oo8, please rewrite your commit history so that it includes only one commit that passes the validations provided here: https://github.com/nodejs/core-validate-commit |
This PR improves the error message thrown by
process.cwd()
when the current working directory is deleted. Instead of throwing a new error, it enhances the original error message, making it clearer that the directory was deleted while the process was still inside it.Changes Made:
wrappedCwd()
to enhance the existing error message forENOENT: uv_cwd
instead of creating a newError
instance.process.chdir()
to switch directories).Before (Old Behavior):
When the working directory was deleted,
process.cwd()
threw a generic error with little context:After (New Behavior):
Now, the error provides a more meaningful message:
Relevant Issue:
(If this PR fixes an issue, add the issue number here)
Example: Fixes #57045
PR-URL:
#57184
Reviewer Notes:
-added to docs