I'm having troubles when the R script fails with an exception. I'm getting a "SyntaxError: Unexpected end of JSON input" when my R code hits an exception.
The problem is that when I hit an R exception, body is an empty string here
|
callback(null, JSON.parse(body)); |
This then causes my whole application to crash!
May I humbly suggest changing this line to
if (body) callback(null, JSON.parse(body));
I'm having troubles when the R script fails with an exception. I'm getting a "SyntaxError: Unexpected end of JSON input" when my R code hits an exception.
The problem is that when I hit an R exception,
bodyis an empty string herer-script/index.js
Line 39 in 9b87a43
This then causes my whole application to crash!
May I humbly suggest changing this line to