File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
inst/include/Rcpp/api/meat Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -56,21 +56,25 @@ inline SEXP Rcpp_eval(SEXP expr, SEXP env) {
5656 // execute the call
5757 Shield<SEXP> res (::Rf_eval (call, R_GlobalEnv));
5858
59- // check for error
60- if (Rf_inherits (res, " error " )) {
59+ // check for condition results (errors, interrupts)
60+ if (Rf_inherits (res, " condition " )) {
6161
62- Shield<SEXP> conditionMessageCall (::Rf_lang2 (
63- ::Rf_install (" conditionMessage" ),
64- res
65- ));
62+ if (Rf_inherits (res, " error" )) {
63+
64+ Shield<SEXP> conditionMessageCall (::Rf_lang2 (
65+ ::Rf_install (" conditionMessage" ),
66+ res
67+ ));
68+
69+ Shield<SEXP> conditionMessage (::Rf_eval (conditionMessageCall, R_GlobalEnv));
70+ throw eval_error (CHAR (STRING_ELT (conditionMessage, 0 )));
71+ }
72+
73+ // check for interrupt
74+ if (Rf_inherits (res, " interrupt" )) {
75+ throw internal::InterruptedException ();
76+ }
6677
67- Shield<SEXP> conditionMessage (::Rf_eval (conditionMessageCall, R_GlobalEnv));
68- throw eval_error (CHAR (STRING_ELT (conditionMessage, 0 )));
69- }
70-
71- // check for interrupt
72- if (Rf_inherits (res, " interrupt" )) {
73- throw internal::InterruptedException ();
7478 }
7579
7680 return res;
You can’t perform that action at this time.
0 commit comments