use of com.haulmont.yarg.exception.ValidationException in project jmix by jmix-framework.
the class JmixGroovyDataLoader method loadData.
@Override
public List<Map<String, Object>> loadData(ReportQuery reportQuery, BandData parentBand, Map<String, Object> params) {
try {
String script = reportQuery.getScript();
Map<String, Object> scriptParams = groovyScriptParametersProvider.prepareParameters(reportQuery, parentBand, params);
script = StringUtils.trim(script);
if (script.endsWith(".groovy")) {
script = resources.getResourceAsString(script);
}
return scripting.evaluateGroovy(script, scriptParams);
} catch (ValidationException e) {
throw e;
} catch (Throwable e) {
throw new DataLoadingException(String.format("An error occurred while loading data for data set [%s]", reportQuery.getName()), e);
}
}
Aggregations