mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
26.05.2007 e451ab682bef06d6435c67e80b3a3be8adf7db2f
Fix for issue 2354 (dsreplication CLI : parallel runs should raise more explicit error information).
The messages have been updated with a reference to the log file and a String representation of the exception that caused the error.
3 files modified
53 ■■■■ changed files
opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java 47 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/admin_tool.properties 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
@@ -2449,7 +2449,7 @@
        {
          returnValue = rce.getErrorCode();
          printLineBreak();
          printErrorMessage(rce.getMessageObject());
          printErrorMessage(getCriticalExceptionMessage(rce));
          LOG.log(Level.SEVERE, "Complete error stack:", rce);
        }
      }
@@ -2542,7 +2542,7 @@
        {
          returnValue = rce.getErrorCode();
          printLineBreak();
          printErrorMessage(rce.getMessageObject());
          printErrorMessage(getCriticalExceptionMessage(rce));
          LOG.log(Level.SEVERE, "Complete error stack:", rce);
        }
      }
@@ -2610,7 +2610,7 @@
      {
        returnValue = rce.getErrorCode();
        printLineBreak();
        printErrorMessage(rce.getMessageObject());
        printErrorMessage(getCriticalExceptionMessage(rce));
        LOG.log(Level.SEVERE, "Complete error stack:", rce);
      }
    }
@@ -2701,7 +2701,7 @@
          catch (ReplicationCliException rce)
          {
            printLineBreak();
            printErrorMessage(rce.getMessageObject());
            printErrorMessage(getCriticalExceptionMessage(rce));
            returnValue = rce.getErrorCode();
            LOG.log(Level.SEVERE, "Complete error stack:", rce);
          }
@@ -5161,4 +5161,43 @@
    }
    return c1;
  }
  /**
   * Returns the message that must be displayed to the user for a given
   * exception.  This is assumed to be a critical exception that stops all
   * the processing.
   * @param rce the ReplicationCliException.
   * @return a message to be displayed to the user.
   */
  private Message getCriticalExceptionMessage(ReplicationCliException rce)
  {
    MessageBuilder mb = new MessageBuilder();
    mb.append(rce.getMessageObject());
    File logFile = QuickSetupLog.getLogFile();
    if (logFile != null)
    {
      mb.append(Constants.LINE_SEPARATOR);
      mb.append(INFO_GENERAL_SEE_FOR_DETAILS.get(logFile.getPath()));
    }
    // Check if the cause has already been included in the message
    Throwable c = rce.getCause();
    if (c != null)
    {
      String s;
      if (c instanceof NamingException)
      {
        s = ((NamingException)c).toString(true);
      }
      else
      {
        s = c.toString();
      }
      if (mb.toString().indexOf(s) == -1)
      {
        mb.append(Constants.LINE_SEPARATOR);
        mb.append(INFO_REPLICATION_CRITICAL_ERROR_DETAILS.get(s));
      }
    }
    return mb.toMessage();
  }
}
opendj-sdk/opends/src/messages/messages/admin_tool.properties
@@ -691,7 +691,7 @@
 in servers %s and %s is different.  This tool does not allow to handle this \
 scenario.
SEVERE_ERR_REPLICATION_ERROR_READING_CONFIGURATION=Error reading replication \
 configuration of server %s.  Details: %s
 configuration of server %s.%nDetails: %s
INFO_REPLICATION_REMOVING_REFERENCES_ON_REMOTE=Removing references on base DN \
 %s of server %s
INFO_REPLICATION_DISABLING_BASEDN=Disabling replication on base DN %s of \
@@ -723,5 +723,5 @@
INFO_REPLICATION_STATUS_LABEL_SECURE=Security:
INFO_REPLICATION_STATUS_SECURITY_ENABLED=Enabled
INFO_REPLICATION_STATUS_SECURITY_DISABLED=Disabled
INFO_REPLICATION_CRITICAL_ERROR_DETAILS=Details: %s
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java
@@ -473,8 +473,6 @@
  }
  /**
<<<<<<< .mine
=======
   * Returns <CODE>true</CODE> if this is a quiet session and
   * <CODE>false</CODE> otherwise.  This method relies on the a previous
   * call to createArgumentParser having been made and the parser