s.append(" ");
//
// Recognize UIMA exceptions and produce more verbose logging
//
if ( a instanceof InternationalizedException ) {
InternationalizedException e = (InternationalizedException) a;
s.append(e.toString());
s.append("\n");
Object[] arguments = e.getArguments();
if ( arguments.length > 0 ) {
s.append("UIMA exception arguments:\n");
}
for ( Object o : arguments ) {
if ( o == null ) o = "<null>"; // avoid npe
s.append(o.toString());
s.append("\n");
}
//
// Dig in to find the original throw, bypassing all
// the annoying infrastructure gorp in between.
//
Throwable nextCause = e.getCause();
if(nextCause != null) {
while ( nextCause.getCause() != null ) {
nextCause = nextCause.getCause();
}
s.append("Caused by:\n");