Browse Source

Improve EEXIST error message for copySync

ci/travis-osximage
RyanZim 8 years ago
parent
commit
f83b13af8f
  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.unlinkSync(destFile)
} 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