Improve error message

This commit is contained in:
Daniel García Aubert 2017-12-12 12:39:12 +01:00
parent 5bc1903677
commit 869f2ac322
2 changed files with 5 additions and 5 deletions

View File

@ -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,'+ 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'; ' interactivity fields or attributes that are not present in the aggregation';
const unsupportedGeometryTypeErrorMessage = ctx => 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 { module.exports = class AggregationMapConfigAdapter {
constructor (pgConnection) { constructor (pgConnection) {

View File

@ -379,13 +379,13 @@ describe('aggregation', function () {
assert.deepEqual(body, { assert.deepEqual(body, {
errors: [ errors: [
'Unsupported geometry type (ST_Polygon) for aggregation.' + 'Unsupported geometry type: ST_Polygon.' +
' Aggregation is available only for points.' ' Aggregation is available only for geometry type: ST_Point'
], ],
errors_with_context:[{ errors_with_context:[{
type: 'unknown', type: 'unknown',
message: 'Unsupported geometry type (ST_Polygon) for aggregation.' + message: 'Unsupported geometry type: ST_Polygon.' +
' Aggregation is available only for points.' ' Aggregation is available only for geometry type: ST_Point'
}] }]
}); });