g <- function() stop("foo")
f <- function() g()
(Rserve.eval(expression(f())))
(Rserve.eval(parse(text="1:5\n1+1")))
(Rserve.eval(quote(1+1), last.value=TRUE))
error_with_condition = function(object = NULL) {
cond = errorCondition("this is a custom error with condition",
object = object,
class = "CustomError")
stop(cond)
}
str(Rserve.eval(quote(error_with_condition("hello")), last.value = TRUE))
Run the code above in your browser using DataLab