From 15f4c4af976c56c76be7f45d306618f56157461c Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 06 Jun 2007 20:06:24 +0000
Subject: [PATCH] The commit insures that in all cases instantiation of ApplicationException is done with a localized message since this the message contained in this exception is exposed to end users.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
index ea6883f..61a40d3 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup.util;
import org.opends.quicksetup.*;
+import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.server.loggers.debug.TextDebugLogPublisher;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.TextErrorLogPublisher;
@@ -407,9 +408,8 @@
StringBuilder error = op.getErrorMessage();
throw new ApplicationException(
ApplicationException.Type.IMPORT_ERROR,
- "error processing modification of '" +
- dnByteString + "': " +
- error != null ? error.toString() : "",
+ getMsg("error-apply-ldif-modify", dnByteString.toString(),
+ error != null ? error.toString() : ""),
null);
}
break;
@@ -431,9 +431,8 @@
StringBuilder error = addOp.getErrorMessage();
throw new ApplicationException(
ApplicationException.Type.IMPORT_ERROR,
- "error processing add of '" +
- dnByteString + "': " +
- error != null ? error.toString() : "",
+ getMsg("error-apply-ldif-add", dnByteString.toString(),
+ error != null ? error.toString() : ""),
null);
}
break;
@@ -449,22 +448,21 @@
StringBuilder error = delOp.getErrorMessage();
throw new ApplicationException(
ApplicationException.Type.IMPORT_ERROR,
- "error processing delete of '" +
- dnByteString + "': " +
- error != null ? error.toString() : "",
+ getMsg("error-apply-ldif-delete", dnByteString.toString(),
+ error != null ? error.toString() : ""),
null);
}
break;
default:
- throw new ApplicationException(
- ApplicationException.Type.IMPORT_ERROR,
- "unexpected change record type " + cre.getClass(),
+ LOG.log(Level.SEVERE, "Unexpected record type " + cre.getClass());
+ throw new ApplicationException(ApplicationException.Type.BUG,
+ getMsg("bug-msg"),
null);
}
}
} catch (Throwable t) {
throw new ApplicationException(ApplicationException.Type.BUG,
- t.getMessage(), t);
+ getMsg("bug-msg"), t);
}
}
@@ -519,4 +517,8 @@
AccessLogger.removeAccessLogPublisher(DN.NULL_DN);
}
+ static private String getMsg(String key, String... args) {
+ return ResourceProvider.getInstance().getMsg(key, args);
+ }
+
}
--
Gitblit v1.10.0