mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-19 01:06:36 +00:00
Don't show a dialog when the write fails.
There is already an error modal and the error detail will be shown in the console. Changelog-entry: Don't show a dialog when the write fails.
This commit is contained in:
parent
63c047009f
commit
1f7e4c886b
@ -22,7 +22,7 @@ const flashState = require('../../../models/flash-state')
|
||||
const driveScanner = require('../../../modules/drive-scanner')
|
||||
const progressStatus = require('../../../modules/progress-status')
|
||||
const notification = require('../../../os/notification')
|
||||
const exceptionReporter = require('../../../modules/exception-reporter')
|
||||
const analytics = require('../../../modules/analytics')
|
||||
const imageWriter = require('../../../modules/image-writer')
|
||||
const path = require('path')
|
||||
const store = require('../../../models/store')
|
||||
@ -145,12 +145,13 @@ module.exports = function (
|
||||
driveScanner.stop()
|
||||
|
||||
const iconPath = '../../../assets/icon.png'
|
||||
const basename = path.basename(image.path)
|
||||
try {
|
||||
await imageWriter.flash(image.path, drives)
|
||||
if (!flashState.wasLastFlashCancelled()) {
|
||||
const flashResults = flashState.getFlashResults()
|
||||
notification.send('Flash complete!', {
|
||||
body: messages.info.flashComplete(path.basename(image.path), drives, flashResults.results.devices),
|
||||
body: messages.info.flashComplete(basename, drives, flashResults.results.devices),
|
||||
icon: iconPath
|
||||
})
|
||||
$state.go('success')
|
||||
@ -181,7 +182,8 @@ module.exports = function (
|
||||
FlashErrorModalService.show(messages.error.childWriterDied())
|
||||
} else {
|
||||
FlashErrorModalService.show(messages.error.genericFlashError())
|
||||
exceptionReporter.report(error)
|
||||
error.image = basename
|
||||
analytics.logException(error)
|
||||
}
|
||||
} finally {
|
||||
availableDrives.setDrives([])
|
||||
|
@ -171,7 +171,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
genericFlashError: () => {
|
||||
return 'Oops, seems something went wrong.'
|
||||
return 'Something went wrong. If it is a compressed image, please check that the archive is not corrupted.'
|
||||
},
|
||||
|
||||
validation: () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user