Skip to content

Report forgotten errors from 'mv'#879

Open
vgalka-sl wants to merge 2 commits intoshelljs:mainfrom
vgalka-sl:mv-errors
Open

Report forgotten errors from 'mv'#879
vgalka-sl wants to merge 2 commits intoshelljs:mainfrom
vgalka-sl:mv-errors

Conversation

@vgalka-sl
Copy link

Fix for issue #878.

@codecov-io
Copy link

codecov-io commented Jul 23, 2018

Codecov Report

Merging #879 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #879   +/-   ##
=======================================
  Coverage   95.81%   95.81%           
=======================================
  Files          34       34           
  Lines        1266     1266           
=======================================
  Hits         1213     1213           
  Misses         53       53
Impacted Files Coverage Δ
src/mv.js 97.77% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4113a72...898deb6. Read the comment docs.

Copy link
Member

@nfischer nfischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test in test/mv.js? Your example in #878 with foo/a/file.js sounds perfect.

cp('-r', src, thisDest);
rm('-rf', src);
} else {
common.error(e.message, { continue: true });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you catch a specific e.code and output a message like mv: cannot move 'foo/a/file.js' to 'bar/a/file.js': No such file or directory?

Also, could you add an else branch with throw e? The distinction is that we only want to use common.error() for expected error conditions, and would prefer to fail loudly with an exception for unexpected conditions (so that we can fix these as they're reported).

@nfischer nfischer added fix Bug/defect, or a fix for such a problem bash compat Compatibility issues with bash or POSIX behavior labels Jul 23, 2018
@nfischer nfischer added this to the v0.8.x milestone Jul 23, 2018
@nfischer
Copy link
Member

nfischer commented Aug 1, 2018

@vgalka-sl any update on this issue? Let me know if I can clarify anything.

@nfischer nfischer removed this from the v0.8.x milestone Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash compat Compatibility issues with bash or POSIX behavior fix Bug/defect, or a fix for such a problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants