]
RH Bugzilla Integration commented on WFLY-3101:
-----------------------------------------------
Paul Gier <pgier(a)redhat.com> changed the Status of [bug
CLI: hide stacktraces for exceptions w/o messages when logging
errors
---------------------------------------------------------------------
Key: WFLY-3101
URL:
https://issues.jboss.org/browse/WFLY-3101
Project: WildFly
Issue Type: Task
Components: CLI
Affects Versions: 8.0.0.Final
Reporter: Alexey Loubyansky
Assignee: Alexey Loubyansky
Fix For: 8.1.0.CR1, 8.1.0.Final
CommandContextImpl contains the following logic
public void handleSafe(String line) {
exitCode = 0;
try {
handle(line);
} catch(Throwable t) {
final StringBuilder buf = new StringBuilder();
buf.append(t.getLocalizedMessage());
Throwable t1 = t.getCause();
while(t1 != null) {
if(t1.getLocalizedMessage() != null) {
buf.append(": ").append(t1.getLocalizedMessage());
} else {
t1.printStackTrace();
}
t1 = t1.getCause();
}
error(buf.toString());
}
}
When an exception does not contain any message, e.g. in some cases
IllegalArgumentException, etc, the full stacktraces are logged that are useful for
debugging but not nice from the user interface point of view. It was suggested to hide
them.