StringWriter sw = new StringWriter();
// Better format for Yalp exceptions
if (e instanceof YalpException) {
YalpException yalpException = (YalpException) e;
PrintWriter errorOut = new PrintWriter(sw);
errorOut.println("");
errorOut.println("");
errorOut.println("@" + yalpException.getId());
errorOut.println(format(message, args));
errorOut.println("");
if (yalpException.isSourceAvailable()) {
errorOut.println(yalpException.getErrorTitle() + " (In " + yalpException.getSourceFile() + " around line " + yalpException.getLineNumber() + ")");
} else {
errorOut.println(yalpException.getErrorTitle());
}
errorOut.println(yalpException.getErrorDescription().replaceAll("</?\\w+/?>", "").replace("\n", " "));
} else {
sw.append(format(message, args));
}
try {