added stack to response in development mode

This commit is contained in:
javi
2014-02-04 14:58:21 +01:00
parent b01570924d
commit 7197cc2d62
+4
View File
@@ -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);