From 869f2ac3227b270371517746f641d083f7b19cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 12 Dec 2017 12:39:12 +0100 Subject: [PATCH] Improve error message --- .../mapconfig/adapter/aggregation-mapconfig-adapter.js | 2 +- test/acceptance/aggregation.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js index e661042c..4217b2cf 100644 --- a/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js +++ b/lib/cartodb/models/mapconfig/adapter/aggregation-mapconfig-adapter.js @@ -5,7 +5,7 @@ const queryUtils = require('../../../utils/query-utils'); const MISSING_AGGREGATION_COLUMNS = 'Missing columns in the aggregation. The map-config defines cartocss expressions,'+ ' interactivity fields or attributes that are not present in the aggregation'; const unsupportedGeometryTypeErrorMessage = ctx => -`Unsupported geometry type (${ctx.geometryType}) for aggregation. Aggregation is available only for points.`; +`Unsupported geometry type: ${ctx.geometryType}. Aggregation is available only for geometry type: ST_Point`; module.exports = class AggregationMapConfigAdapter { constructor (pgConnection) { diff --git a/test/acceptance/aggregation.js b/test/acceptance/aggregation.js index ef06b1bd..9c1fed45 100644 --- a/test/acceptance/aggregation.js +++ b/test/acceptance/aggregation.js @@ -379,13 +379,13 @@ describe('aggregation', function () { assert.deepEqual(body, { errors: [ - 'Unsupported geometry type (ST_Polygon) for aggregation.' + - ' Aggregation is available only for points.' + 'Unsupported geometry type: ST_Polygon.' + + ' Aggregation is available only for geometry type: ST_Point' ], errors_with_context:[{ type: 'unknown', - message: 'Unsupported geometry type (ST_Polygon) for aggregation.' + - ' Aggregation is available only for points.' + message: 'Unsupported geometry type: ST_Polygon.' + + ' Aggregation is available only for geometry type: ST_Point' }] });