Remove dead code

Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-05-14 14:42:32 +02:00
parent a3a9edd41a
commit 52f80293a2

View File

@ -108,24 +108,17 @@ async function flashImageToDrive(
goToSuccess(); goToSuccess();
} }
} catch (error) { } catch (error) {
// When flashing is cancelled before starting above there is no error
if (!error) {
return '';
}
notification.send( notification.send(
'Oops! Looks like the flash failed.', 'Oops! Looks like the flash failed.',
messages.error.flashFailure(path.basename(image.path), drives), messages.error.flashFailure(path.basename(image.path), drives),
iconPath, iconPath,
); );
let errorMessage = getErrorMessageFromCode(error.code); let errorMessage = getErrorMessageFromCode(error.code);
if (!errorMessage) { if (!errorMessage) {
error.image = basename; error.image = basename;
analytics.logException(error); analytics.logException(error);
errorMessage = messages.error.genericFlashError(error); errorMessage = messages.error.genericFlashError(error);
} }
return errorMessage; return errorMessage;
} finally { } finally {
availableDrives.setDrives([]); availableDrives.setDrives([]);