Added error handling

This commit is contained in:
Henry 2015-10-29 17:15:20 -07:00
parent 92a3fa3e4c
commit 05722d9b11
3 changed files with 10 additions and 6 deletions

View File

@ -20,7 +20,8 @@
"glyph": "+",
"category": "contextual",
"implementation": "actions/CopyAction.js",
"depends": ["locationService", "copyService", "dialogService", "notificationService"]
"depends": ["$log", "locationService", "copyService",
"dialogService", "notificationService"]
},
{
"key": "link",

View File

@ -34,9 +34,10 @@ define(
* @constructor
* @memberof platform/entanglement
*/
function CopyAction(locationService, copyService, dialogService, notificationService, context) {
function CopyAction($log, locationService, copyService, dialogService, notificationService, context) {
this.dialogService = dialogService;
this.notificationService = notificationService;
this.$log = $log;
AbstractComposeAction.call(this, locationService, copyService, context, "Duplicate", "to a location");
}
@ -75,9 +76,9 @@ define(
AbstractComposeAction.prototype.perform.call(this, progress)
.then(function(){
self.notificationService.info("Copying complete.");
},
function (error){
//log error
})
.catch(function (error){
self.$log.error("Error copying objects. ", error);
//Show more general error message
self.notificationService.notify({
title: "Error copying objects.",

View File

@ -122,7 +122,9 @@ define(
}
/**
* Will persist a list of {@link objectClones}.
* Will persist a list of {@link objectClones}. It will persist all
* simultaneously, irrespective of order in the list. This may
* result in automatic request batching by the browser.
* @private
* @param progress
* @returns {Function} a function that will perform the persistence