style(CLI): improve error message when drive doesn't exist anymore (#1222)

The current message is short and unfriendly.

Fixes: https://github.com/resin-io/etcher/issues/1125
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-03-28 09:41:38 -04:00 committed by GitHub
parent 63dda89035
commit da85aa31aa

View File

@ -80,7 +80,10 @@ isElevated().then((elevated) => {
});
if (!selectedDrive) {
throw errors.createUserError('Drive not found', `${answers.drive} doesn't exist`);
throw errors.createUserError(
'The selected drive was not found',
`We can't find ${answers.drive} in your system. Did you unplug the drive?`
);
}
return writer.writeImage(imagePath, selectedDrive, {