From 0a331cee372ff5816a5eef7950ac8c92f6513a69 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 16 Mar 2015 00:03:59 +0100 Subject: [PATCH] do not redefine vars --- lib/cartodb/controllers/template_maps.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cartodb/controllers/template_maps.js b/lib/cartodb/controllers/template_maps.js index f683412d..5dd425b2 100644 --- a/lib/cartodb/controllers/template_maps.js +++ b/lib/cartodb/controllers/template_maps.js @@ -157,10 +157,10 @@ TemplateMapsController.prototype.retrieve = function(req, res) { tpl_id = req.params.template_id.split('@'); if ( tpl_id.length > 1 ) { if ( tpl_id[0] != cdbuser ) { - var err = new Error("Cannot get template id '" + req.params.template_id + "' for user '" + cdbuser + - "'"); - err.http_status = 404; - throw err; + var templateNotFoundErr = new Error("Cannot get template id '" + req.params.template_id + + "' for user '" + cdbuser + "'"); + templateNotFoundErr.http_status = 404; + throw templateNotFoundErr; } tpl_id = tpl_id[1]; } @@ -219,10 +219,10 @@ TemplateMapsController.prototype.destroy = function(req, res) { tpl_id = req.params.template_id.split('@'); if ( tpl_id.length > 1 ) { if ( tpl_id[0] != cdbuser ) { - var err = new Error("Cannot find template id '" + req.params.template_id + "' for user '" + - cdbuser + "'"); - err.http_status = 404; - throw err; + var templateNotFoundErr = new Error("Cannot find template id '" + req.params.template_id + + "' for user '" + cdbuser + "'"); + templateNotFoundErr.http_status = 404; + throw templateNotFoundErr; } tpl_id = tpl_id[1]; }