This commit is contained in:
Poonam Bajaj 2017-05-04 19:25:53 +00:00
commit 862b3dff42

View File

@ -393,7 +393,7 @@ public class Agent {
} catch (JdpException e) {
error(e);
} catch (AgentConfigurationError err) {
error(err.getError(), err.getParams());
error(err);
}
}
@ -454,7 +454,7 @@ public class Agent {
}
} catch (AgentConfigurationError e) {
error(e.getError(), e.getParams());
error(e);
} catch (Exception e) {
error(e);
}
@ -665,18 +665,6 @@ public class Agent {
throw new RuntimeException(keyText);
}
public static void error(String key, String[] params) {
if (params == null || params.length == 0) {
error(key);
} else {
StringBuilder message = new StringBuilder(params[0]);
for (int i = 1; i < params.length; i++) {
message.append(' ').append(params[i]);
}
error(key, message.toString());
}
}
public static void error(String key, String message) {
String keyText = getText(key);
System.err.print(getText("agent.err.error") + ": " + keyText);
@ -690,6 +678,23 @@ public class Agent {
throw new RuntimeException(e);
}
public static void error(AgentConfigurationError e) {
String keyText = getText(e.getError());
String[] params = e.getParams();
System.err.print(getText("agent.err.error") + ": " + keyText);
if (params != null && params.length != 0) {
StringBuffer message = new StringBuffer(params[0]);
for (int i = 1; i < params.length; i++) {
message.append(" " + params[i]);
}
System.err.println(": " + message);
}
e.printStackTrace();
throw new RuntimeException(e);
}
public static void warning(String key, String message) {
System.err.print(getText("agent.err.warning") + ": " + getText(key));
System.err.println(": " + message);