From 76da828168f593b6a3a578a23bab94687491a2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 16 Jan 2018 17:55:09 +0100 Subject: [PATCH] Use error label as middleware argument --- lib/cartodb/controllers/named_maps.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index f3aff5bd..5744633a 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -46,9 +46,9 @@ NamedMapsController.prototype.register = function(app) { cors(), userMiddleware, this.prepareContext, - this.getNamedMapProvider(), + this.getNamedMapProvider('NAMED_MAP_TILE'), this.getAffectedTables(), - this.getTile(), + this.getTile('NAMED_MAP_TILE'), this.setSurrogateKey(), this.setCacheChannelHeader(), this.setLastModifiedHeader(), @@ -177,7 +177,7 @@ NamedMapsController.prototype.prepareLayerFilterFromPreviewLayers = function (la }.bind(this); }; -NamedMapsController.prototype.getTile = function () { +NamedMapsController.prototype.getTile = function (label) { return function getTileMiddleware (req, res, next) { const { namedMapProvider } = res.locals; @@ -185,7 +185,7 @@ NamedMapsController.prototype.getTile = function () { req.profiler.add(stats); if (err) { - err.label = 'NAMED_MAP_TILE'; + err.label = label; return next(err); }