From f6b7b0d3d2b009d3f8473d71d8ebf7c136fbefa3 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 27 Jan 2020 11:43:04 +0100 Subject: [PATCH] Fix error reportning when elevating Etcher fails Change-type: patch --- lib/gui/app/modules/image-writer.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/gui/app/modules/image-writer.ts b/lib/gui/app/modules/image-writer.ts index fcd5dd8b..53fb659e 100644 --- a/lib/gui/app/modules/image-writer.ts +++ b/lib/gui/app/modules/image-writer.ts @@ -291,15 +291,15 @@ export async function flash( } catch (error) { flashState.unsetFlashingFlag({ cancelled: false, errorCode: error.code }); windowProgress.clear(); - const { results } = flashState.getFlashResults(); - const eventData = _.assign( - { - errors: results.errors, - devices: results.devices, - status: 'failed', - }, - analyticsData, - ); + let { results } = flashState.getFlashResults(); + results = results || {}; + const eventData = { + ...analyticsData, + errors: results.errors, + devices: results.devices, + status: 'failed', + error, + }; analytics.logEvent('Write failed', eventData); throw error; }