From 20dca2e8f88d593935aa57b37a5de842d44e2bcd Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 11 Oct 2012 16:48:41 +0200 Subject: [PATCH] Use windshaft-0.6.2 sendError function to send non-200 responses Ensures all errors are logged --- lib/cartodb/cartodb_windshaft.js | 9 ++++++--- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index e4536a82..86854861 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -37,7 +37,8 @@ var CartodbWindshaft = function(serverOptions) { }, function(err, data){ if (err){ - res.send({error: err.message}, 500); + ws.sendError(res, {error: err.message}, 500, 'GET INFOWINDOW'); + //res.send({error: err.message}, 500); } else { res.send({infowindow: data}, 200); } @@ -57,7 +58,8 @@ var CartodbWindshaft = function(serverOptions) { }, function(err, data){ if (err){ - res.send(err.message, 500); + ws.sendError(res, {error: err.message}, 500, 'GET MAP_METADATA'); + //res.send(err.message, 500); } else { res.send({map_metadata: data}, 200); } @@ -77,7 +79,8 @@ var CartodbWindshaft = function(serverOptions) { }, function(err, data){ if (err){ - res.send(500); + ws.sendError(res, {error: err.message}, 500, 'DELETE CACHE'); + //res.send(500); } else { res.send({status: 'ok'}, 200); } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5862215f..d49f6031 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3,7 +3,7 @@ "version": "1.1.0", "dependencies": { "cluster2": { - "version": "0.3.5-cdb01", + "version": "0.3.5-cdb02", "from": "git://github.com/CartoDB/cluster2.git#cdb_production", "dependencies": { "express": { @@ -245,7 +245,7 @@ } }, "windshaft": { - "version": "0.6.1", + "version": "0.6.2", "dependencies": { "express": { "version": "2.5.11", @@ -273,7 +273,7 @@ "version": "4.3.1", "dependencies": { "optimist": { - "version": "0.3.4", + "version": "0.3.5", "dependencies": { "wordwrap": { "version": "0.0.2" diff --git a/package.json b/package.json index ebceadeb..c9cd7025 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "node-varnish": "0.1.1", "underscore" : "~1.3.3", "grainstore" : "~0.9.1", - "windshaft" : "~0.6.1", + "windshaft" : "~0.6.2", "step": "0.0.x", "generic-pool": "1.0.x", "redis": "0.7.2",