mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 13:43:09 +00:00
Added error handling
This commit is contained in:
parent
92a3fa3e4c
commit
05722d9b11
@ -20,7 +20,8 @@
|
||||
"glyph": "+",
|
||||
"category": "contextual",
|
||||
"implementation": "actions/CopyAction.js",
|
||||
"depends": ["locationService", "copyService", "dialogService", "notificationService"]
|
||||
"depends": ["$log", "locationService", "copyService",
|
||||
"dialogService", "notificationService"]
|
||||
},
|
||||
{
|
||||
"key": "link",
|
||||
|
@ -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.",
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user