From 9f0eb1a26745e51dc39184882d542583ba4ab7e5 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 14 Mar 2007 20:32:37 +0000
Subject: [PATCH] Update the LDAP client tools so that they provide error messages in a more readable format. They can now generate up to four lines of output in the following order:
---
opends/src/server/org/opends/server/tools/LDAPDelete.java | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPDelete.java b/opends/src/server/org/opends/server/tools/LDAPDelete.java
index 5d38681..59742a5 100644
--- a/opends/src/server/org/opends/server/tools/LDAPDelete.java
+++ b/opends/src/server/org/opends/server/tools/LDAPDelete.java
@@ -205,8 +205,9 @@
else
{
msgID = MSGID_OPERATION_FAILED;
- String msg = getMessage(msgID, "DELETE", line, ae.getMessage());
+ String msg = getMessage(msgID, "DELETE");
err.println(wrapText(msg, MAX_LINE_WIDTH));
+ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return;
}
}
@@ -219,15 +220,17 @@
!deleteOptions.continueOnError())
{
msgID = MSGID_OPERATION_FAILED;
- String msg = getMessage(msgID, "DELETE", line, errorMessage);
- throw new LDAPException(resultCode, msgID, msg);
+ String msg = getMessage(msgID, "DELETE");
+ throw new LDAPException(resultCode, errorMessage, msgID, msg,
+ op.getMatchedDN(), null);
} else
{
if(resultCode != SUCCESS && resultCode != REFERRAL)
{
msgID = MSGID_OPERATION_FAILED;
- String msg = getMessage(msgID, "DELETE", line, errorMessage);
- err.println(wrapText(msg, MAX_LINE_WIDTH));
+ String msg = getMessage(msgID, "DELETE");
+ LDAPToolUtils.printErrorMessage(err, msg, resultCode, errorMessage,
+ op.getMatchedDN());
} else
{
msgID = MSGID_OPERATION_SUCCESSFUL;
@@ -746,7 +749,8 @@
{
debugCaught(DebugLogLevel.ERROR, le);
}
- err.println(wrapText(le.getMessage(), MAX_LINE_WIDTH));
+ LDAPToolUtils.printErrorMessage(err, le.getMessage(), le.getResultCode(),
+ le.getErrorMessage(), le.getMatchedDN());
int code = le.getResultCode();
return code;
} catch(LDAPConnectionException lce)
@@ -755,8 +759,11 @@
{
debugCaught(DebugLogLevel.ERROR, lce);
}
- err.println(wrapText(lce.getMessage(), MAX_LINE_WIDTH));
- int code = lce.getErrorCode();
+ LDAPToolUtils.printErrorMessage(err, lce.getMessage(),
+ lce.getResultCode(),
+ lce.getErrorMessage(),
+ lce.getMatchedDN());
+ int code = lce.getResultCode();
return code;
} catch(Exception e)
{
--
Gitblit v1.10.0