From 970310bf7f4a3cffdeb257053886319064859479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Tue, 7 Nov 2017 16:01:08 +0100 Subject: [PATCH] add vectorError middleware to named map endpoint --- lib/cartodb/controllers/named_maps.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index 759ae4b6..442db927 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -9,6 +9,7 @@ var BaseController = require('./base'); var cors = require('../middleware/cors'); var userMiddleware = require('../middleware/user'); var allowQueryParams = require('../middleware/allow-query-params'); +var vectorError = require('../middleware/vector-error'); function NamedMapsController(prepareContext, namedMapProviderCache, tileBackend, previewBackend, surrogateKeysCache, tablesExtentApi, metadataBackend) { @@ -33,7 +34,8 @@ NamedMapsController.prototype.register = function(app) { cors(), userMiddleware, this.prepareContext, - this.tile.bind(this) + this.tile.bind(this), + vectorError() ); app.get( @@ -108,6 +110,7 @@ NamedMapsController.prototype.tile = function(req, res, next) { }, function handleImage(err, tile, headers, stats) { req.profiler.add(stats); + if (err) { err.label = 'NAMED_MAP_TILE'; next(err);