From 9cb82023d108d4701e53c79b97bd5f4053a1a4f4 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 01 Oct 2009 15:42:52 +0000
Subject: [PATCH] Improve the generic error messages details part.

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java |   54 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 58c2e30..2a162a9 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1136,35 +1136,39 @@
       String hostPort)
   {
     Message msg;
-    if (Utils.isCertificateException(ne))
+    String arg;
+    if (ne.getLocalizedMessage() != null)
     {
-      msg = INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE_SERVER.get(
-              hostPort, ne.toString(true));
-    }
-    else if (ne instanceof AuthenticationException)
-    {
-      msg = INFO_CANNOT_CONNECT_TO_REMOTE_AUTHENTICATION.get(hostPort,
-          ne.toString(true));
-    }
-    else if (ne instanceof NoPermissionException)
-    {
-      msg = INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS.get(hostPort,
-          ne.toString(true));
-    }
-    else if (ne instanceof NamingSecurityException)
-    {
-      msg = INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS.get(hostPort,
-          ne.toString(true));
-    }
-    else if (ne instanceof CommunicationException)
-    {
-      msg = ERR_CANNOT_CONNECT_TO_REMOTE_COMMUNICATION.get(
-          hostPort, ne.toString(true));
+      arg = ne.getLocalizedMessage();
     }
     else
     {
-       msg = INFO_CANNOT_CONNECT_TO_REMOTE_GENERIC.get(
-          hostPort, ne.toString(true));
+      arg = ne.toString(true);
+    }
+    if (Utils.isCertificateException(ne))
+    {
+      msg = INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE_SERVER.get(
+          hostPort, arg);
+    }
+    else if (ne instanceof AuthenticationException)
+    {
+      msg = INFO_CANNOT_CONNECT_TO_REMOTE_AUTHENTICATION.get(hostPort, arg);
+    }
+    else if (ne instanceof NoPermissionException)
+    {
+      msg = INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS.get(hostPort, arg);
+    }
+    else if (ne instanceof NamingSecurityException)
+    {
+      msg = INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS.get(hostPort, arg);
+    }
+    else if (ne instanceof CommunicationException)
+    {
+      msg = ERR_CANNOT_CONNECT_TO_REMOTE_COMMUNICATION.get(hostPort, arg);
+    }
+    else
+    {
+       msg = INFO_CANNOT_CONNECT_TO_REMOTE_GENERIC.get(hostPort, arg);
     }
     return msg;
   }

--
Gitblit v1.10.0