Handle errors from syntactically invalid R