[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",
"implementation": ExportTimelineAsCSVAction,
"depends": [
"$log",
"exportService",
"notificationService",
"resources[]"

View File

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