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);