diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index 4d98b2b7..a9f2f327 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -61,9 +61,9 @@ MapController.prototype.register = function(app) { includeQuery: true }), respond, - mapErrorMiddleware({ + augmentError({ label: 'ANONYMOUS LAYERGROUP', - augmentError: true + addContext: true }) ); app.post( @@ -78,9 +78,9 @@ MapController.prototype.register = function(app) { includeQuery: true }), respond, - mapErrorMiddleware({ + augmentError({ label: 'ANONYMOUS LAYERGROUP', - augmentError: true + addContext: true }) ); app.get( @@ -95,7 +95,7 @@ MapController.prototype.register = function(app) { useTemplateHash: true }), respond, - mapErrorMiddleware({ + augmentError({ label: 'NAMED MAP LAYERGROUP' }) ); @@ -111,7 +111,7 @@ MapController.prototype.register = function(app) { useTemplateHash: true }), respond, - mapErrorMiddleware({ + augmentError({ label: 'NAMED MAP LAYERGROUP' }) ); @@ -584,8 +584,8 @@ MapController.prototype.addWidgetsUrl = function(username, layergroup, mapConfig } }; -function mapErrorMiddleware (options) { - const { augmentError = false, label = 'MAPS CONTROLLER' } = options; +function augmentError (options) { + const { addContext = false, label = 'MAPS CONTROLLER' } = options; return function mapError (err, req, res, next) { const { mapconfig } = res.locals;