mirror of
https://github.com/nasa/openmct.git
synced 2025-06-03 16:10:54 +00:00
Added error handling
This commit is contained in:
parent
92a3fa3e4c
commit
05722d9b11
@ -20,7 +20,8 @@
|
|||||||
"glyph": "+",
|
"glyph": "+",
|
||||||
"category": "contextual",
|
"category": "contextual",
|
||||||
"implementation": "actions/CopyAction.js",
|
"implementation": "actions/CopyAction.js",
|
||||||
"depends": ["locationService", "copyService", "dialogService", "notificationService"]
|
"depends": ["$log", "locationService", "copyService",
|
||||||
|
"dialogService", "notificationService"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "link",
|
"key": "link",
|
||||||
|
@ -34,9 +34,10 @@ define(
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @memberof platform/entanglement
|
* @memberof platform/entanglement
|
||||||
*/
|
*/
|
||||||
function CopyAction(locationService, copyService, dialogService, notificationService, context) {
|
function CopyAction($log, locationService, copyService, dialogService, notificationService, context) {
|
||||||
this.dialogService = dialogService;
|
this.dialogService = dialogService;
|
||||||
this.notificationService = notificationService;
|
this.notificationService = notificationService;
|
||||||
|
this.$log = $log;
|
||||||
AbstractComposeAction.call(this, locationService, copyService, context, "Duplicate", "to a location");
|
AbstractComposeAction.call(this, locationService, copyService, context, "Duplicate", "to a location");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,9 +76,9 @@ define(
|
|||||||
AbstractComposeAction.prototype.perform.call(this, progress)
|
AbstractComposeAction.prototype.perform.call(this, progress)
|
||||||
.then(function(){
|
.then(function(){
|
||||||
self.notificationService.info("Copying complete.");
|
self.notificationService.info("Copying complete.");
|
||||||
},
|
})
|
||||||
function (error){
|
.catch(function (error){
|
||||||
//log error
|
self.$log.error("Error copying objects. ", error);
|
||||||
//Show more general error message
|
//Show more general error message
|
||||||
self.notificationService.notify({
|
self.notificationService.notify({
|
||||||
title: "Error copying objects.",
|
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
|
* @private
|
||||||
* @param progress
|
* @param progress
|
||||||
* @returns {Function} a function that will perform the persistence
|
* @returns {Function} a function that will perform the persistence
|
||||||
|
Loading…
x
Reference in New Issue
Block a user