use of jdk.nashorn.internal.runtime.ParserException in project engineblock by engineblock.
the class RawYamlStatementLoader method parseYaml.
protected RawStmtsDocList parseYaml(Logger logger, String data) {
Yaml yaml = getCustomYaml();
try {
Iterable<Object> objects = yaml.loadAll(data);
List<RawStmtsDoc> stmtListList = new ArrayList<>();
for (Object object : objects) {
RawStmtsDoc tgsd = (RawStmtsDoc) object;
stmtListList.add(tgsd);
}
return new RawStmtsDocList(stmtListList);
} catch (ParserException pe) {
if (logger != null)
logger.error("yaml-parsing-error: Error parsing YAML:" + pe.getMessage() + "" + " For more details on this error see " + "http://docs.engineblock.io/user-guide/standard_yaml/#yaml-parsing-error", pe);
throw pe;
} catch (Exception e) {
if (logger != null)
logger.error("yaml-construction-error: Error building configuration:" + e.getMessage() + "" + " For more details on this error see " + "http://docs.engineblock.io/user-guide/standard_yaml/#yaml-construction-error", e);
throw e;
}
}
Aggregations