summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2009-12-03 23:07:26 +0000
committerRobert Gemmell <robbie@apache.org>2009-12-03 23:07:26 +0000
commit095d573ebd5c1a3f6cec3e9c6425f6282e343be7 (patch)
treeee525f42c6fee8681e7834f139926177493a7109 /java
parent5020ec12fbf9a7f692c10ef25f332de21840e06a (diff)
downloadqpid-python-095d573ebd5c1a3f6cec3e9c6425f6282e343be7.tar.gz
QPID-2233: convey the exception messsage to provide useful feedback to users during connection failure
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@886975 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
index 12906d1ff4..5d892f5503 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
@@ -49,8 +49,6 @@ public class AbstractAction
protected IWorkbenchWindow _window;
- public static final String SECURITY_FAILURE = "User authentication failed";
- public static final String SERVER_UNAVAILABLE = "Unable to connect to the specified Qpid JMX server";
public static final String INVALID_PERSPECTIVE = "Invalid Perspective";
public static final String CHANGE_PERSPECTIVE = "Please use the Qpid Management Perspective";
@@ -153,18 +151,16 @@ public class AbstractAction
return;
}
}
- else if (ex instanceof IOException)
+ else if (ex instanceof IOException || ex instanceof SecurityException )
{
- //uncaught IOException, eg when trying to connect to a server/port with no JMX server running
- msg = SERVER_UNAVAILABLE;
- //Display error dialogue and return
- displayErrorDialogue(msg, title);
- return;
- }
- else if (ex instanceof SecurityException)
- {
- //SecurityException when providing incorrect login credentials
- msg = SECURITY_FAILURE;
+ msg = ex.getMessage();
+
+ //if msg is still null, try reporting the cause.
+ if ((msg == null) && (ex.getCause() != null))
+ {
+ msg = ex.getCause().getMessage();
+ }
+
//Display error dialogue and return
displayErrorDialogue(msg, title);
return;