hdt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsha...@apache.org
Subject [5/6] git commit: HDT-55 - Adding Error Handling to ZooKeeper Actions - Modified actions to log error and show Error dialog - Do not add ZooKeeper if error in connection
Date Fri, 23 May 2014 03:21:12 GMT
HDT-55 - Adding Error Handling to ZooKeeper Actions - Modified actions to log error and show
Error dialog - Do not add ZooKeeper if error in connection


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

Branch: refs/heads/hadoop-eclipse-merge-development
Commit: 08355408b16dd99f5bbba84a750b4f29b4f497e5
Parents: 092213c
Author: Rahul Sharma <rsharma@apache.org>
Authored: Fri May 16 12:02:08 2014 +0530
Committer: Rahul Sharma <rsharma@apache.org>
Committed: Fri May 23 08:47:33 2014 +0530

----------------------------------------------------------------------
 .../zookeeper/InterruptableZooKeeperClient.java |  5 +-
 .../internal/zookeeper/ZooKeeperManager.java    | 47 +++++-----
 .../hdt/ui/internal/zookeeper/DeleteAction.java | 91 +++++++++++---------
 .../ui/internal/zookeeper/DisconnectAction.java | 52 +++++++----
 .../internal/zookeeper/NewZooKeeperWizard.java  | 12 ++-
 .../ui/internal/zookeeper/ReconnectAction.java  | 54 ++++++++----
 .../ZooKeeperCommonContentProvider.java         | 10 +--
 7 files changed, 164 insertions(+), 107 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/InterruptableZooKeeperClient.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/InterruptableZooKeeperClient.java
b/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/InterruptableZooKeeperClient.java
index 133b9dd..38c5664 100644
--- a/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/InterruptableZooKeeperClient.java
+++ b/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/InterruptableZooKeeperClient.java
@@ -93,7 +93,10 @@ public class InterruptableZooKeeperClient extends ZooKeeperClient {
 			// Tell HDFS manager that the server timed out
 			if (logger.isDebugEnabled())
 				logger.debug("executeWithTimeout(): Server timed out: " + server);
-			ZooKeeperManager.INSTANCE.disconnect(server);
+			try {
+			  ZooKeeperManager.INSTANCE.disconnect(server);
+			} catch (Throwable t) {
+			}
 			throw new InterruptedException();
 		}
 		if (data.size() > 0)

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/ZooKeeperManager.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/ZooKeeperManager.java
b/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/ZooKeeperManager.java
index 4c36259..87b5cd5 100644
--- a/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/ZooKeeperManager.java
+++ b/org.apache.hdt.core/src/org/apache/hdt/core/internal/zookeeper/ZooKeeperManager.java
@@ -35,6 +35,8 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.emf.common.util.EList;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
 
 /**
  * @author Srimanth Gunturi
@@ -62,11 +64,20 @@ public class ZooKeeperManager {
 	/**
 	 * @param zkServerName
 	 * @param uri
+	 * @throws CoreException 
+	 * @throws InterruptedException 
+	 * @throws IOException 
 	 */
-	public ZooKeeperServer createServer(String zkServerName, String zkServerLocation) {
+	public ZooKeeperServer createServer(String zkServerName, String zkServerLocation) throws
 CoreException {
 		ZooKeeperServer zkServer = HadoopFactory.eINSTANCE.createZooKeeperServer();
 		zkServer.setName(zkServerName);
 		zkServer.setUri(zkServerLocation);
+		try {
+			ZooKeeperManager.INSTANCE.getClient(zkServer).connect();
+		} catch (Exception e) {
+			logger.error("Error getting children of node", e);
+			throw new CoreException(new Status(Status.ERROR, Activator.BUNDLE_ID, "Error in creating
server",e));
+		}
 		getServers().add(zkServer);
 		HadoopManager.INSTANCE.saveServers();
 		return zkServer;
@@ -74,22 +85,18 @@ public class ZooKeeperManager {
 
 	/**
 	 * @param r
+	 * @throws CoreException 
 	 */
-	public void disconnect(ZooKeeperServer server) {
+	public void disconnect(ZooKeeperServer server) throws CoreException {
 		try {
 			if (ServerStatus.DISCONNECTED_VALUE != server.getStatusCode()) {
 				getClient(server).disconnect();
 				server.setStatusCode(ServerStatus.DISCONNECTED_VALUE);
 			}
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (InterruptedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (CoreException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+		} catch (Exception e) {
+			logger.error("Error in disconnet", e);
+			throw new CoreException(new Status(IStatus.ERROR, Activator.BUNDLE_ID,
+					"Unable to disconnect.",e));
 		}
 	}
 
@@ -97,8 +104,9 @@ public class ZooKeeperManager {
 	 * Provides a ZooKeeper instance using plugin extensions.
 	 * 
 	 * @param r
+	 * @throws CoreException 
 	 */
-	public void reconnect(ZooKeeperServer server) {
+	public void reconnect(ZooKeeperServer server) throws CoreException {
 		try {
 			if (logger.isDebugEnabled())
 				logger.debug("reconnect(): Reconnecting: " + server);
@@ -111,18 +119,11 @@ public class ZooKeeperManager {
 			}
 			if (logger.isDebugEnabled())
 				logger.debug("reconnect(): Reconnected: " + server);
-		} catch (IOException e) {
-			server.setStatusCode(ServerStatus.DISCONNECTED_VALUE);
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (InterruptedException e) {
-			server.setStatusCode(ServerStatus.DISCONNECTED_VALUE);
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (CoreException e) {
+		} catch (Exception e) {
 			server.setStatusCode(ServerStatus.DISCONNECTED_VALUE);
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			logger.error("Error in disconnet", e);
+			throw new CoreException(new Status(IStatus.ERROR, Activator.BUNDLE_ID,
+					"Unable to reconnect.",e));
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DeleteAction.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DeleteAction.java
b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DeleteAction.java
index 599c011..0147b6b 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DeleteAction.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DeleteAction.java
@@ -18,7 +18,6 @@
  */
 package org.apache.hdt.ui.internal.zookeeper;
 
-import java.io.IOException;
 import java.util.Iterator;
 
 import org.apache.hdt.core.internal.model.ZNode;
@@ -27,9 +26,12 @@ import org.apache.hdt.core.internal.zookeeper.ZooKeeperManager;
 import org.apache.hdt.core.zookeeper.ZooKeeperClient;
 import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.navigator.resources.ProjectExplorer;
@@ -39,7 +41,12 @@ public class DeleteAction implements IObjectActionDelegate {
 	private final static Logger logger = Logger.getLogger(DeleteAction.class);
 	private ISelection selection;
 	private IWorkbenchPart targetPart;
-
+	
+	
+	private void showError(String message) {
+		MessageDialog.openError(Display.getDefault().getActiveShell(), 
+				"ZooKeeper Delete Error", message);
+	}
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -47,48 +54,54 @@ public class DeleteAction implements IObjectActionDelegate {
 	 */
 	@Override
 	public void run(IAction action) {
-		if (this.selection != null && !this.selection.isEmpty()) {
-			IStructuredSelection sSelection = (IStructuredSelection) this.selection;
-			@SuppressWarnings("rawtypes")
-			Iterator itr = sSelection.iterator();
-			while (itr.hasNext()) {
-				Object object = itr.next();
-				if (object instanceof ZooKeeperServer) {
-					ZooKeeperServer r = (ZooKeeperServer) object;
-					if (logger.isDebugEnabled())
-						logger.debug("Deleting: " + r);
-					try {
-						ZooKeeperManager.INSTANCE.disconnect(r);
-					} finally {
+		Display.getDefault().syncExec(new Runnable() {
+			@Override
+			public void run() {
+				if (selection != null && !selection.isEmpty()) {
+				IStructuredSelection sSelection = (IStructuredSelection) selection;
+				@SuppressWarnings("rawtypes")
+				Iterator itr = sSelection.iterator();
+				while (itr.hasNext()) {
+					Object object = itr.next();
+					if (object instanceof ZooKeeperServer) {
+						ZooKeeperServer r = (ZooKeeperServer) object;
+						if (logger.isDebugEnabled())
+							logger.debug("Deleting: " + r);
 						try {
-							ZooKeeperManager.INSTANCE.delete(r);
+							ZooKeeperManager.INSTANCE.disconnect(r);
 						} catch (CoreException e) {
-							logger.error(e.getMessage());
+							logger.error("Error occurred ", e);
+						} finally {
+							 try {
+								ZooKeeperManager.INSTANCE.delete(r);
+							} catch (CoreException e) {
+								logger.error("Error occurred ", e);
+								IStatus status = e.getStatus();
+								showError(status.getException().getMessage());
+							}
+						}
+						if (logger.isDebugEnabled())
+							logger.debug("Deleted: " + r);
+						if (targetPart instanceof ProjectExplorer) {
+							ProjectExplorer pe = (ProjectExplorer) targetPart;
+							pe.getCommonViewer().refresh();
+						}
+					} else if (object instanceof ZNode) {
+						ZNode zkn = (ZNode) object;
+						if (logger.isDebugEnabled())
+							logger.debug("Deleting: " + zkn);
+						try {
+							ZooKeeperClient client = ZooKeeperManager.INSTANCE.getClient(zkn.getServer());
+							client.delete(zkn);
+						} catch (Exception e) {
+							logger.error("Error occurred ", e);
+							showError(e.getMessage());
 						}
-					}
-					if (logger.isDebugEnabled())
-						logger.debug("Deleted: " + r);
-					if (targetPart instanceof ProjectExplorer) {
-						ProjectExplorer pe = (ProjectExplorer) targetPart;
-						pe.getCommonViewer().refresh();
-					}
-				} else if (object instanceof ZNode) {
-					ZNode zkn = (ZNode) object;
-					if (logger.isDebugEnabled())
-						logger.debug("Deleting: " + zkn);
-					try {
-						ZooKeeperClient client = ZooKeeperManager.INSTANCE.getClient(zkn.getServer());
-						client.delete(zkn);
-					} catch (CoreException e) {
-						logger.error(e.getMessage(), e);
-					} catch (IOException e) {
-						logger.error(e.getMessage(), e);
-					} catch (InterruptedException e) {
-						logger.error(e.getMessage(), e);
 					}
 				}
-			}
-		}
+			}}
+		});
+		
 	}
 
 	/*

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DisconnectAction.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DisconnectAction.java
b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DisconnectAction.java
index d335c79..af293c5 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DisconnectAction.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/DisconnectAction.java
@@ -24,9 +24,12 @@ import org.apache.hdt.core.internal.model.ServerStatus;
 import org.apache.hdt.core.internal.model.ZooKeeperServer;
 import org.apache.hdt.core.internal.zookeeper.ZooKeeperManager;
 import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.navigator.resources.ProjectExplorer;
@@ -37,6 +40,10 @@ public class DisconnectAction implements IObjectActionDelegate {
 	private ISelection selection;
 	private IWorkbenchPart targetPart;
 
+	private void showError(String message) {
+		MessageDialog.openError(Display.getDefault().getActiveShell(), 
+				"ZooKeeper Disconnect Error",message);
+	}
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -44,26 +51,33 @@ public class DisconnectAction implements IObjectActionDelegate {
 	 */
 	@Override
 	public void run(IAction action) {
-		if (this.selection != null && !this.selection.isEmpty()) {
-			IStructuredSelection sSelection = (IStructuredSelection) this.selection;
-			@SuppressWarnings("rawtypes")
-			Iterator itr = sSelection.iterator();
-			while (itr.hasNext()) {
-				Object object = itr.next();
-				if (object instanceof ZooKeeperServer) {
-					ZooKeeperServer r = (ZooKeeperServer) object;
-					if(logger.isDebugEnabled())
-						logger.debug("Disconnecting: "+r);
-					ZooKeeperManager.INSTANCE.disconnect(r);
-					if(logger.isDebugEnabled())
-						logger.debug("Disconnected: "+r);
-					if (targetPart instanceof ProjectExplorer) {
-						ProjectExplorer pe = (ProjectExplorer) targetPart;
-						pe.getCommonViewer().refresh(r, true);
+		Display.getDefault().syncExec(new Runnable() {
+			@Override
+			public void run() {
+			if (selection != null && !selection.isEmpty()) {
+				IStructuredSelection sSelection = (IStructuredSelection) selection;
+				@SuppressWarnings("rawtypes")
+				Iterator itr = sSelection.iterator();
+				while (itr.hasNext()) {
+					Object object = itr.next();
+					if (object instanceof ZooKeeperServer) {
+						ZooKeeperServer r = (ZooKeeperServer) object;
+						if(logger.isDebugEnabled())
+							logger.debug("Disconnecting: "+r);
+						try {
+							ZooKeeperManager.INSTANCE.disconnect(r);
+						} catch (CoreException e) {
+							logger.error("Error occurred ", e);
+							showError(e.getStatus().getException().getMessage());
+						}
+						if(logger.isDebugEnabled())
+							logger.debug("Disconnected: "+r);
+						if (targetPart instanceof ProjectExplorer) {
+							ProjectExplorer pe = (ProjectExplorer) targetPart;
+							pe.getCommonViewer().refresh(r, true);
+						}
 					}
-				}
-			}
-		}
+				}}}});
 	}
 
 	/*

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
index 60e740b..9a8e7c0 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
@@ -24,8 +24,10 @@ import org.apache.hdt.ui.internal.launch.ServerRegistry;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
@@ -80,7 +82,15 @@ public class NewZooKeeperWizard extends Wizard implements INewWizard,IExecutable
 
 				Job j = new Job("Creating ZooKeeper project [" + serverLocationWizardPage.getZkServerName()
+ "]") {
 					protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor
monitor) {
-						ZooKeeperManager.INSTANCE.createServer(serverLocationWizardPage.getZkServerName(),
serverLocationWizardPage.getZkServerLocation());
+						try {
+							ZooKeeperManager.INSTANCE.createServer(serverLocationWizardPage.getZkServerName(),
serverLocationWizardPage.getZkServerLocation());
+						} catch (final CoreException e) {
+							Display.getDefault().syncExec(new Runnable(){
+								public void run(){
+								IStatus status = e.getStatus();
+								MessageDialog.openError(Display.getDefault().getActiveShell(), 
+									"ZooKeeper Error", status.getMessage()+" "+status.getException().getMessage());}});
+						}
 						return Status.OK_STATUS;
 					};
 				};

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ReconnectAction.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ReconnectAction.java
b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ReconnectAction.java
index 17d228c..e5905bc 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ReconnectAction.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ReconnectAction.java
@@ -24,9 +24,13 @@ import org.apache.hdt.core.internal.model.ServerStatus;
 import org.apache.hdt.core.internal.model.ZooKeeperServer;
 import org.apache.hdt.core.internal.zookeeper.ZooKeeperManager;
 import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.navigator.resources.ProjectExplorer;
@@ -37,6 +41,10 @@ public class ReconnectAction implements IObjectActionDelegate {
 	private ISelection selection;
 	private IWorkbenchPart targetPart;
 
+	private void showError(String message) {
+		MessageDialog.openError(Display.getDefault().getActiveShell(), 
+				"ZooKeeper Re-connect Error", message);
+	}
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -44,26 +52,34 @@ public class ReconnectAction implements IObjectActionDelegate {
 	 */
 	@Override
 	public void run(IAction action) {
-		if (this.selection != null && !this.selection.isEmpty()) {
-			IStructuredSelection sSelection = (IStructuredSelection) this.selection;
-			@SuppressWarnings("rawtypes")
-			Iterator itr = sSelection.iterator();
-			while (itr.hasNext()) {
-				Object object = itr.next();
-				if (object instanceof ZooKeeperServer) {
-					ZooKeeperServer r = (ZooKeeperServer) object;
-					if(logger.isDebugEnabled())
-						logger.debug("Reconnecting: "+r);
-					ZooKeeperManager.INSTANCE.reconnect(r);
-					if(logger.isDebugEnabled())
-						logger.debug("Reconnected: "+r);
-					if (targetPart instanceof ProjectExplorer) {
-						ProjectExplorer pe = (ProjectExplorer) targetPart;
-						pe.getCommonViewer().refresh(r, true);
+		Display.getDefault().syncExec(new Runnable() {
+			@Override
+			public void run() {
+			if (selection != null && !selection.isEmpty()) {
+				IStructuredSelection sSelection = (IStructuredSelection) selection;
+				@SuppressWarnings("rawtypes")
+				Iterator itr = sSelection.iterator();
+				while (itr.hasNext()) {
+					Object object = itr.next();
+					if (object instanceof ZooKeeperServer) {
+						ZooKeeperServer r = (ZooKeeperServer) object;
+						if(logger.isDebugEnabled())
+							logger.debug("Reconnecting: "+r);
+						try {
+							ZooKeeperManager.INSTANCE.reconnect(r);
+						} catch (CoreException e) {
+							logger.error("Error occurred ", e);
+							IStatus status = e.getStatus();
+							showError(status.getException().getMessage());
+						}
+						if(logger.isDebugEnabled())
+							logger.debug("Reconnected: "+r);
+						if (targetPart instanceof ProjectExplorer) {
+							ProjectExplorer pe = (ProjectExplorer) targetPart;
+							pe.getCommonViewer().refresh(r, true);
+						}
 					}
-				}
-			}
-		}
+				}}}});
 	}
 
 	/*

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/08355408/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ZooKeeperCommonContentProvider.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ZooKeeperCommonContentProvider.java
b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ZooKeeperCommonContentProvider.java
index 1579846..0c816e3 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ZooKeeperCommonContentProvider.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/ZooKeeperCommonContentProvider.java
@@ -32,6 +32,7 @@ import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IMemento;
@@ -91,12 +92,11 @@ public class ZooKeeperCommonContentProvider implements ICommonContentProvider
{
 				ZooKeeperClient client = ZooKeeperManager.INSTANCE.getClient(zkn.getServer());
 				List<ZNode> zkChildren = client.getChildren(zkn);
 				return zkChildren.toArray();
-			} catch (CoreException e) {
-				logger.error("Error getting children of node", e);
-			} catch (IOException e) {
-				logger.error("Error getting children of node", e);
-			} catch (InterruptedException e) {
+			} catch (Exception e) {
 				logger.error("Error getting children of node", e);
+				MessageDialog.openError(Display.getDefault().getActiveShell(), 
+						"ZooKeeper Error",e.getMessage());
+			
 			}
 		}
 		return null;


Mime
View raw message