Catch aggregation query errors

This commit is contained in:
Javier Goizueta 2018-10-03 23:13:22 +02:00
parent 99b62edcbd
commit c9786ee3f6

View File

@ -95,7 +95,14 @@ module.exports = class AggregationMapConfigAdapter {
const sqlQueryWrap = layer.options.sql_wrap;
let aggregationSql = mapConfig.getAggregatedQuery(index);
let aggregationSql;
try {
aggregationSql = mapConfig.getAggregatedQuery(index);
}
catch (error) {
return reject(error);
}
if (sqlQueryWrap) {
aggregationSql = sqlQueryWrap.replace(/<%=\s*sql\s*%>/g, aggregationSql);