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