From e1bcf8ffdd858706f50232896e25ca82ce911517 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 2 Jul 2012 23:17:32 +0200 Subject: o Better error messages when unable to parse JSON. o Fixing typos. --- routes/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'routes') diff --git a/routes/index.js b/routes/index.js index efed59c..5f2c79c 100644 --- a/routes/index.js +++ b/routes/index.js @@ -42,7 +42,10 @@ exports.render = function(req, res) { var parsedBody; try { parsedBody = JSON.parse(body); - } catch(e) { sendErr('Unable to parse JSON: ' + e); } + } catch(e) { + sendErr('Unable to parse JSON: ' + e); + return; + } var collection = collection_json.fromObject(parsedBody).collection; var isUrl = function(u) { try { -- cgit v1.2.3