From 7197cc2d629ffebc09062b40a733b19deb19b61d Mon Sep 17 00:00:00 2001 From: javi Date: Tue, 4 Feb 2014 14:58:21 +0100 Subject: [PATCH] added stack to response in development mode --- lib/cartodb/cartodb_windshaft.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index a66f8e2c..d098bbb8 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -10,6 +10,7 @@ var _ = require('underscore') , Cache = require('./cache_validator'); var CartodbWindshaft = function(serverOptions) { + var debug = global.environment.environment === 'development'; if(serverOptions.cache_enabled) { console.log("cache invalidation enabled, varnish on ", serverOptions.varnish_host, ' ', serverOptions.varnish_port); @@ -493,6 +494,9 @@ var CartodbWindshaft = function(serverOptions) { if ( ! _.isUndefined(err.http_status) ) { statusCode = err.http_status; } + if(debug) { + response.stack = err.stack; + } ws.sendError(res, response, statusCode, 'POST INSTANCE TEMPLATE', err.message); } else { res.send(response, 200);