From ac0f1eb1836314c9ba240ee578b8e8a5e62b5574 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.
---
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java | 54 +++++++++++++++++++++++++++++-------------------------
1 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index 58c2e30..2a162a9 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/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