[Timeline] Log errors during CSV export

#751
This commit is contained in:
Victor Woeltjen
2016-05-25 10:35:29 -07:00
parent 0e4f6185b8
commit ed519d89d7
2 changed files with 7 additions and 2 deletions

View File

@ -92,6 +92,7 @@ define([
"category": "contextual", "category": "contextual",
"implementation": ExportTimelineAsCSVAction, "implementation": ExportTimelineAsCSVAction,
"depends": [ "depends": [
"$log",
"exportService", "exportService",
"notificationService", "notificationService",
"resources[]" "resources[]"

View File

@ -34,11 +34,13 @@ define(["./ExportTimelineAsCSVTask"], function (ExportTimelineAsCSVTask) {
* @memberof {platform/features/timeline} * @memberof {platform/features/timeline}
*/ */
function ExportTimelineAsCSVAction( function ExportTimelineAsCSVAction(
$log,
exportService, exportService,
notificationService, notificationService,
resources, resources,
context context
) { ) {
this.$log = $log;
this.task = new ExportTimelineAsCSVTask( this.task = new ExportTimelineAsCSVTask(
exportService, exportService,
resources, resources,
@ -52,13 +54,15 @@ define(["./ExportTimelineAsCSVTask"], function (ExportTimelineAsCSVTask) {
notification = notificationService.notify({ notification = notificationService.notify({
title: "Exporting CSV", title: "Exporting CSV",
unknownProgress: true unknownProgress: true
}); }),
$log = this.$log;
return this.task.run() return this.task.run()
.then(function () { .then(function () {
notification.dismiss(); notification.dismiss();
}) })
.catch(function () { .catch(function (err) {
$log.warn(err);
notification.dismiss(); notification.dismiss();
notificationService.error("Error exporting CSV"); notificationService.error("Error exporting CSV");
}); });