From 526f46909841bfbf26be6920d7b58df2a79d282d Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Wed, 30 Sep 2015 11:08:52 +0000
Subject: [PATCH] SSDM-2450 : Polishing

SVN: 34752
---
 .../1/as/webapps/eln-lims/html/js/server/ServerFacade.js    | 2 +-
 .../js/views/SampleTable/widgets/MoveSampleController.js    | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
index ebf541fe6d1..2e59b3b7875 100644
--- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
+++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js
@@ -413,7 +413,7 @@ function ServerFacade(openbisServer) {
 					if(data.result.rows[0][0].value == "OK") {
 						callbackFunction(true);
 					} else {
-						callbackFunction(false);
+						callbackFunction(false, data.result.rows[0][1].value);
 					}
 				});
 	}
diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/MoveSampleController.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/MoveSampleController.js
index 1f3f0e4fb83..f30ffb7c44b 100644
--- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/MoveSampleController.js
+++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleTable/widgets/MoveSampleController.js
@@ -46,7 +46,7 @@ function MoveSampleController(samplePermId, successAction) {
 		mainController.serverFacade.moveSample(
 				this._moveSampleModel.sample.identifier,
 				this._moveSampleModel.experimentIdentifier,
-				this._moveSampleModel.experimentType, function(isOK) {
+				this._moveSampleModel.experimentType, function(isOK, errorMessage) {
 					if(isOK) {
 						Util.showSuccess("Sample " + _this._moveSampleModel.sample.identifier + " moved to " + _this._moveSampleModel.experimentIdentifier, function() { 
 							Util.unblockUI(); 
@@ -60,7 +60,9 @@ function MoveSampleController(samplePermId, successAction) {
 							} 
 						});
 					} else {
-						Util.showError("Sample " + _this._moveSampleModel.sample.identifier + " failed " + _this._moveSampleModel.experimentIdentifier, function() {});
+						Util.showError("Sample " + _this._moveSampleModel.sample.identifier + " failed to move to " + _this._moveSampleModel.experimentIdentifier + " with error: " + errorMessage, function() {
+							Util.unblockUI();
+						});
 					}
 				});
 	}
-- 
GitLab