fix(GUI): emit an analytics event on ENOSPC (#1044)

There exists a change the user will run out of space on his drive when
flashing an image format for which we can't guarantee its uncompressed
size (e.g: gzip and bzip2).

When that happens, we show a friendly error message explaining what
happened, however we should also be emitting an analytics event.

Change-Type: patch
Changelog-Entry: Emit an analytics event on `ENOSPC`.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-01-25 10:32:26 -04:00 committed by GitHub
parent 2b303f51ba
commit 87a782f6ff

View File

@ -79,6 +79,7 @@ module.exports = function(
AnalyticsService.logEvent('Validation error'); AnalyticsService.logEvent('Validation error');
} else if (error.code === 'ENOSPC') { } else if (error.code === 'ENOSPC') {
FlashErrorModalService.show(messages.error.notEnoughSpaceInDrive()); FlashErrorModalService.show(messages.error.notEnoughSpaceInDrive());
AnalyticsService.logEvent('Out of space');
} else { } else {
FlashErrorModalService.show(messages.error.genericFlashError()); FlashErrorModalService.show(messages.error.genericFlashError());
ErrorService.reportException(error); ErrorService.reportException(error);