mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
fix(gui): De-serialize errors from flashResults
Change-Type: patch
This commit is contained in:
parent
0199243ce9
commit
1d4ea2164f
@ -132,12 +132,16 @@ exports.performWrite = (image, drives, onProgress) => {
|
||||
failed: 0
|
||||
}
|
||||
}
|
||||
|
||||
ipc.server.on('fail', (error) => {
|
||||
console.log('Fail:', error)
|
||||
})
|
||||
|
||||
ipc.server.on('done', (results) => {
|
||||
_.merge(flashResults, results)
|
||||
ipc.server.on('done', (event) => {
|
||||
event.results.errors = _.map(event.results.errors, (data) => {
|
||||
return errors.fromJSON(data)
|
||||
})
|
||||
_.merge(flashResults, event)
|
||||
})
|
||||
|
||||
ipc.server.on('state', (progress) => {
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
const _ = require('lodash')
|
||||
const ipc = require('node-ipc')
|
||||
const EXIT_CODES = require('../../shared/exit-codes')
|
||||
const errors = require('../../shared/errors')
|
||||
@ -138,6 +139,9 @@ ipc.connectTo(IPC_SERVER_ID, () => {
|
||||
*/
|
||||
const onFinish = (results) => {
|
||||
log(`Finish: ${results.bytesWritten}`)
|
||||
results.errors = _.map(results.errors, (error) => {
|
||||
return errors.toJSON(error)
|
||||
})
|
||||
ipc.of[IPC_SERVER_ID].emit('done', { results })
|
||||
terminate(exitCode)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user