Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions in R code poorly handled #40

Open
ccornchip opened this issue Nov 30, 2020 · 0 comments
Open

Exceptions in R code poorly handled #40

ccornchip opened this issue Nov 30, 2020 · 0 comments

Comments

@ccornchip
Copy link

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));
majidpk added a commit to majidpk/r-script that referenced this issue Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant