Browse Source

Merge pull request #296 from jprichardson/eexist-error

Improve EEXIST error message for copySync
ci/travis-osximage
JP Richardson 8 years ago
committed by GitHub
parent
commit
18ec8baf13
  1. 6
      lib/copy-sync/copy-file-sync.js

6
lib/copy-sync/copy-file-sync.js

@ -12,7 +12,11 @@ function copyFileSync (srcFile, destFile, options) {
fs.chmodSync(destFile, parseInt('777', 8)) fs.chmodSync(destFile, parseInt('777', 8))
fs.unlinkSync(destFile) fs.unlinkSync(destFile)
} else { } else {
throw Error('EEXIST') var err = new Error('EEXIST: ' + destFile + ' already exists.')
err.code = 'EEXIST'
err.errno = -17
err.path = destFile
throw err
} }
} }

Loading…
Cancel
Save