@@ -1917,13 +1917,25 @@ PREDICATE(r_eval_, 1)
1917
1917
{
1918
1918
Language id (" identity" ) ;
1919
1919
id.push_back (Expr) ;
1920
- Res = id. eval ( ) ;
1920
+ Res = Rcpp_eval (id, Environment::global_env () ) ;
1921
1921
}
1922
+
1923
+ catch (const Rcpp::eval_error& ex)
1924
+ {
1925
+ throw PlException (PlTerm_string (ex.what ())) ;
1926
+ }
1927
+
1928
+ catch (std::runtime_error& ex)
1929
+ {
1930
+ throw PlException (PlTerm_string (ex.what ())) ;
1931
+ }
1932
+
1922
1933
catch (std::exception & ex)
1923
1934
{
1924
1935
throw PlException (PlTerm_string (ex.what ())) ;
1925
1936
return false ;
1926
1937
}
1938
+
1927
1939
catch (...)
1928
1940
{
1929
1941
throw PlException (PlTerm_string (" unknown exception" )) ;
@@ -1954,13 +1966,25 @@ PREDICATE(r_eval_, 2)
1954
1966
{
1955
1967
Language id (" identity" ) ;
1956
1968
id.push_back (Expr) ;
1957
- Res = id. eval ( ) ;
1969
+ Res = Rcpp_eval (id, Environment::global_env () ) ;
1958
1970
}
1971
+
1972
+ catch (const Rcpp::eval_error& ex)
1973
+ {
1974
+ throw PlException (PlTerm_string (ex.what ())) ;
1975
+ }
1976
+
1977
+ catch (std::runtime_error& ex)
1978
+ {
1979
+ throw PlException (PlTerm_string (ex.what ())) ;
1980
+ }
1981
+
1959
1982
catch (std::exception & ex)
1960
1983
{
1961
1984
throw PlException (PlTerm_string (ex.what ())) ;
1962
1985
return false ;
1963
1986
}
1987
+
1964
1988
catch (...)
1965
1989
{
1966
1990
throw PlException (PlTerm_string (" unknown exception" )) ;
@@ -1975,14 +1999,16 @@ PREDICATE(r_eval_, 2)
1975
1999
return false ;
1976
2000
}
1977
2001
}
2002
+
1978
2003
catch (std::exception & ex)
1979
2004
{
1980
2005
throw PlException (PlTerm_string (ex.what ())) ;
1981
2006
return false ;
1982
2007
}
2008
+
1983
2009
catch (...)
1984
2010
{
1985
- throw PlException (PlTerm_string (" unknown exception " )) ;
2011
+ throw PlException (PlTerm_string (" unknown exception1 " )) ;
1986
2012
return false ;
1987
2013
}
1988
2014
0 commit comments