Environment environment,
Writer writer)
throws TemplateException {
try {
if (exception.getCause().getClass() == NoSuchMessageException.class) {
NoSuchMessageException ex = (NoSuchMessageException) exception.getCause();
writer.write(ex.getMessage());
} else {
writer.write("Error: ");
writer.write(exception.getMessage());
}
} catch (IOException ex) {
log.warn(ex.getMessage(), ex);
}
}