in src/main/java/com/epam/digital/data/platform/excerpt/worker/service/FreemarkerRenderer.java [42:59]
public String render(String templateName, String templateStr, Object jsonData) {
try (var result = new StringWriter()) {
var template = new Template(templateName, templateStr, freemarker);
template.process(jsonData, result);
return result.toString();
} catch (TemplateException e) {
log.error("Template to xml conversion fails", e);
throw new ExcerptProcessingException(FAILED, "Template to xml conversion fails");
} catch (IOException e) {
log.error("IOException occurred while processing the template", e);
throw new ExcerptProcessingException(FAILED,
"IOException occurred while processing the template");
} catch (Exception e) {
log.error("An unexpected error occurred while processing the template", e);
throw new ExcerptProcessingException(FAILED,
"An unexpected error occurred while processing the template");
}
}