ArrayList<Message> messages = new ArrayList<Message>(errors.size());
for (LessCompiler.Problem error : errors) {
String text = error.getMessage() != null ? error.getMessage() : "There is an error in your .less file";
String errorName = error.getType().name();
LessSource source = error.getSource();
Message msg;
if (source != null) {
msg = new Message(MetaModelPluginImpl.COMPILATION_ERROR, errorName, source.getName(), error.getLine(), text);
} else {
msg = new Message(MetaModelPluginImpl.GENERAL_PROBLEM, errorName, text);
}
MetaModelPluginImpl.log.info(msg.toDisplayString());
messages.add(msg);
}
throw new ProcessingException(messages);
}
}