opends/src/messages/messages/tools.properties
@@ -2567,5 +2567,7 @@ MILD_ERR_MAKELDIF_CANNOT_WRITE_ENTRY_WITHOUT_DN_1713=An error occurred while \ attempting to write entry to LDIF: Could not calculate the DN for the \ entry (no value found for the RDN attribute %s) INFO_LABEL_DBTEST_INDEX_UNDEFINED_RECORD_COUNT_1714=Undefined SEVERE_ERR_CLIENT_SIDE_TIMEOUT_1714=A client side timeout occurred.\ %nAdditional Information: %s INFO_LABEL_DBTEST_INDEX_UNDEFINED_RECORD_COUNT_1715=Undefined opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -87,13 +87,13 @@ // The message ID counter to use for requests. private AtomicInteger nextMessageID; private final AtomicInteger nextMessageID; // The print stream to use for standard error. private PrintStream err; private final PrintStream err; // The print stream to use for standard output. private PrintStream out; private final PrintStream out; // Tells whether the command-line is being executed in script friendly mode // or not. @@ -225,7 +225,8 @@ } if (!compareOptions.continueOnError()) { throw new IOException(ae.getMessage()); String message = LDAPToolUtils.getMessageForConnectionException(ae); throw new IOException(message, ae); } else { @@ -991,7 +992,6 @@ connection.connectToHost(bindDNValue, bindPasswordValue, nextMessageID, timeout); ldapCompare = new LDAPCompare(nextMessageID, out, err); ldapCompare.isScriptFriendly = scriptFriendlyArgument.isPresent(); if(fileNameValue == null && dnStrings.isEmpty()) opends/src/server/org/opends/server/tools/LDAPDelete.java
@@ -201,7 +201,8 @@ } if (!deleteOptions.continueOnError()) { throw new IOException(ae.getMessage()); String msg = LDAPToolUtils.getMessageForConnectionException(ae); throw new IOException(msg, ae); } else { opends/src/server/org/opends/server/tools/LDAPModify.java
@@ -98,13 +98,13 @@ private static final String CLASS_NAME = "org.opends.server.tools.LDAPModify"; // The message ID counter to use for requests. private AtomicInteger nextMessageID; private final AtomicInteger nextMessageID; // The print stream to use for standard error. private PrintStream err; private final PrintStream err; // The print stream to use for standard output. private PrintStream out; private final PrintStream out; // The LDIF file name. private String fileName = null; @@ -352,7 +352,8 @@ err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH)); if (!modifyOptions.continueOnError()) { throw new IOException(ae.getMessage()); String msg = LDAPToolUtils.getMessageForConnectionException(ae); throw new IOException(msg, ae); } return; } opends/src/server/org/opends/server/tools/LDAPToolUtils.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Copyright 2006-2009 Sun Microsystems, Inc. * Copyright 2006-2010 Sun Microsystems, Inc. */ package org.opends.server.tools; import org.opends.messages.Message; @@ -31,7 +31,9 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.PrintStream; import java.net.SocketTimeoutException; import org.opends.server.protocols.asn1.ASN1Exception; import org.opends.server.protocols.ldap.LDAPControl; import org.opends.server.protocols.ldap.LDAPResultCode; import org.opends.server.types.DN; @@ -277,5 +279,43 @@ err.println(ERR_TOOL_MATCHED_DN.get(matchedDN.toString())); } } /** * Returns the message to be displayed to the user when an exception occurs. * <br> * The code simply checks that the exception corresponds to a client side * time out. * @param ae the asn1exception that occurred connecting to the server or * handling the response from the server. * @return the message to be displayed to the user when an exception occurs. */ public static String getMessageForConnectionException(ASN1Exception ae) { String msg; Throwable cause = ae.getCause(); if (cause != null) { boolean isTimeout = false; while (cause != null && !isTimeout) { isTimeout = cause instanceof SocketTimeoutException; cause = cause.getCause(); } if (isTimeout) { msg = ERR_CLIENT_SIDE_TIMEOUT.get( ae.getMessageObject().toString()).toString(); } else { msg = ae.getMessageObject().toString(); } } else { msg = ae.getMessageObject().toString(); } return msg; } }