Handle ENOENT windows errors

This commit is contained in:
Juan Cruz Viotti 2015-01-28 15:51:36 -04:00
parent 00623833cc
commit e9e02e3272

View File

@ -92,4 +92,11 @@ exports.writeImage = (devicePath, imagePath, options = {}, callback = _.noop) ->
if error.code is 'EBUSY'
error.message = "Try umounting #{error.path} first."
if error.code is 'ENOENT'
error.message = "Invalid device #{error.path}"
# Prevents outer handler to take
# it as an usual ENOENT error
delete error.code
return callback(error)