jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.43k stars 775 forks source link

fs.copySync doesn't throw any err while it is failing #1032

Closed ganshuyu closed 8 months ago

ganshuyu commented 8 months ago

// Sync: try { fs.copySync('/tmp/myfile', '/tmp/mynewfile') console.log('success!') } catch (err) { console.error(err) -->Never trigger this line running. }

Node.js v18.12.0 fs-extra: 11.2.0

ganshuyu commented 8 months ago

Sorry, my bad. I checked the source file existing before running fs.copySync. For non-existent file, it has no change to run fs.copySync in my previous code. So close this issue. Thank you.