NIHVIVO-1461 Log specific error messages to distinguish template parse exception from template not found exception.
This commit is contained in:
parent
2e200c6142
commit
6e9a877e07
1 changed files with 9 additions and 1 deletions
|
@ -89,7 +89,15 @@ public class TemplateProcessingHelper {
|
|||
try {
|
||||
template = config.getTemplate(templateName);
|
||||
} catch (IOException e) {
|
||||
throw new TemplateProcessingException("Cannot find template " + templateName);
|
||||
String msg;
|
||||
if (e instanceof freemarker.core.ParseException) {
|
||||
msg = "Syntax error in template " + templateName;
|
||||
} else if (e instanceof java.io.FileNotFoundException) {
|
||||
msg = "Cannot find template " + templateName;
|
||||
} else {
|
||||
msg = "IOException getting template " + templateName;
|
||||
}
|
||||
throw new TemplateProcessingException(msg);
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue