ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-92:Updated Test Connection Error messages
Date Sun, 12 Oct 2014 16:57:44 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master 1b8fff511 -> 6beed95f5


ARGUS-92:Updated Test Connection Error messages

Signed-off-by: sneethiraj <sneethir@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/6beed95f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/6beed95f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/6beed95f

Branch: refs/heads/master
Commit: 6beed95f5b805a0ee2846fb14eeaa214bcc745f5
Parents: 1b8fff5
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Sat Oct 11 16:46:38 2014 -0400
Committer: sneethiraj <sneethir@apache.org>
Committed: Sun Oct 12 12:57:17 2014 -0400

----------------------------------------------------------------------
 .../hadoop/client/config/BaseClient.java        |  4 +-
 .../webapp/scripts/views/asset/AssetCreate.js   | 61 ++++++++++----------
 2 files changed, 35 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/6beed95f/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
----------------------------------------------------------------------
diff --git a/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
b/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
index 43f94e4..17acdf7 100644
--- a/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
+++ b/lookup-client/src/main/java/com/xasecure/hadoop/client/config/BaseClient.java
@@ -152,7 +152,9 @@ public abstract class BaseClient {
 		List<String> errList = new ArrayList<String>();
 		while (excp != null) {
 			if (!errList.contains(excp.getMessage() + ". \n")) {
-				errList.add(excp.getMessage() + ". \n");
+				if (excp.getMessage() != null && !(excp.getMessage().equalsIgnoreCase(""))) {
+					errList.add(excp.getMessage() + ". \n");
+				}
 			}
 			excp = excp.getCause();
 		}

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/6beed95f/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js b/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
index b63faa1..b49b950 100644
--- a/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/asset/AssetCreate.js
@@ -226,38 +226,41 @@ define(function(require){
 					//wait: true,
 					success: function (msResponse, options) {
 						if(msResponse.statusCode){
-							if(!_.isUndefined(msResponse) && _.isArray(msResponse.messageList) 
-														  && !_.isUndefined(msResponse.messageList[0].message)){
-								if(!_.isEmpty(msResponse.messageList[0].message) && msResponse.messageList[0].message
!= "\n"){
-									var msg = '<div class="connection-error-font">'+msResponse.messageList[0].message.split('\n').join('<br>')+'</div>'
-									var msgHtml = '<b>Connection Failed.</b></br>'+msg;
-									bootbox.dialog(msgHtml,	[{
-										label: "Show More..",
-										callback:function(e){
-											console.log(e)
-											if($(e.currentTarget).text() == 'Show More..'){
-												var div = '<div class="showMore">'+msResponse.msgDesc+'</div>';
-												$(e.delegateTarget).find('.modal-body').append(div)
-												$(e.currentTarget).html('Show Less..')
-											}else{
-												$(e.delegateTarget).find('.showMore').remove();
-												$(e.currentTarget).html('Show More..')
-											}
-											return false;
-										}
-									}, {
-										label: "OK",
-										callback:function(){}
-									}]
-									);
+							if(!_.isUndefined(msResponse) && !_.isUndefined(msResponse.msgDesc)){ 
+								var popupBtnOpts;
+                               if(!_.isEmpty(msResponse.msgDesc)){
+                            	   if(_.isArray(msResponse.messageList) && !_.isUndefined(msResponse.messageList[0].message)
+                            			   && !_.isEmpty(msResponse.messageList[0].message)){
+	                            		   popupBtnOpts = [{
+	                            			   label: "Show More..",
+	                            			   callback:function(e){
+	                            				   console.log(e)
+	                            				   if($(e.currentTarget).text() == 'Show More..'){
+                        							   var div = '<div class="showMore connection-error-font"><br>'+msResponse.messageList[0].message.split('\n').join('<br>')+'</div>'
+                        							   $(e.delegateTarget).find('.modal-body').append(div)
+                        							   $(e.currentTarget).html('Show Less..')
+	                            				   }else{
+	                            					   $(e.delegateTarget).find('.showMore').remove();
+	                            					   $(e.currentTarget).html('Show More..')
+	                            				   }
+	                            				   return false;
+	                            			   }
+	                            		   }, {
+	                            			   label: "OK",
+	                            			   callback:function(){}
+	                            		   }];
+                            	   }else{
+                            		   		popupBtnOpts = [{label: "OK",
+                            		   			callback:function(){}
+                            		   		}];
+                            	   }
+                                   var msgHtml = '<b>Connection Failed.</b></br>'+msResponse.msgDesc;
+                                   bootbox.dialog(msgHtml, popupBtnOpts);
 								}else{
-									if(!_.isEmpty(msResponse.msgDesc))
-										bootbox.alert(msResponse.msgDesc);
-									else
-										bootbox.alert("Connection Problem.");
+										bootbox.alert("Connection Failed.");
 								}
 							}else{
-								bootbox.alert("Connection Problem.");
+								bootbox.alert("Connection Failed.");
 							}
 						}
 						else


Mime
View raw message