From 08b91f935d52a9eb9501339f35b44a6ec6825647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 2 Nov 2017 18:38:34 +0100 Subject: [PATCH] Rename error middleware --- lib/cartodb/controllers/map.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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;