mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-25 15:57:18 +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
|
||||
}
|
||||
}
|
||||
|
||||
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