} catch (MultipleCompilationErrorsException e) {
if (e.getErrorCollector().getLastError() != null) {
Message errorMsg = e.getErrorCollector().getLastError();
if (errorMsg instanceof SyntaxErrorMessage) {
SyntaxErrorMessage errorMessage = (SyntaxErrorMessage) e.getErrorCollector().getLastError();
SyntaxException syntaxException = errorMessage.getCause();
Integer line = this.linesMatrix.get(syntaxException.getLine());
if (line == null) {
line = 0;
}
String message = syntaxException.getMessage();
if (message.indexOf("@") > 0) {
message = message.substring(0, message.lastIndexOf("@"));
}
throw new TemplateCompilationException(this, line, message);
} else{
ExceptionMessage errorMessage = (ExceptionMessage ) e.getErrorCollector().getLastError();
Exception exception = errorMessage.getCause();
Integer line = 0;
String message = exception.getMessage();
throw new TemplateCompilationException(this, line, message);
}
}