summaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-07-02 23:17:32 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-07-02 23:17:32 +0200
commite1bcf8ffdd858706f50232896e25ca82ce911517 (patch)
tree6397c53d11deb9bf67718cc7de1d864da68b0db1 /routes
parent021dc27bd0101f24cd615b187938fbadf5fdcc89 (diff)
downloadcollection-json-explorer-e1bcf8ffdd858706f50232896e25ca82ce911517.tar.gz
collection-json-explorer-e1bcf8ffdd858706f50232896e25ca82ce911517.tar.bz2
collection-json-explorer-e1bcf8ffdd858706f50232896e25ca82ce911517.tar.xz
collection-json-explorer-e1bcf8ffdd858706f50232896e25ca82ce911517.zip
o Better error messages when unable to parse JSON.
o Fixing typos.
Diffstat (limited to 'routes')
-rw-r--r--routes/index.js5
1 files changed, 4 insertions, 1 deletions
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 {