diff --git a/index.js b/index.js index db6101c..bb19cc2 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,11 @@ R.prototype.call = function(_opts, _callback) { body += d; }); child.on("close", function(code) { - callback(null, JSON.parse(body)); + try { + callback(null, JSON.parse(body)); + } catch(err) { + callback(err, null); + } }); };