static SEXP exception_to_r_condition( const std::exception& ex){ std::string ex_class = Rcpp::demangle( typeid(ex).name() ) ; std::string ex_msg = ex.what() ; Scoped<SEXP> cppstack = rcpp_get_stack_trace() ; Scoped<SEXP> call = get_last_call() ; Scoped<SEXP> classes = get_exception_classes(ex_class) ; Scoped<SEXP> condition = make_condition( ex_msg, call, cppstack, classes ) ; rcpp_set_stack_trace( R_NilValue ) ; return condition ; }
SEXP exception_to_r_condition( const std::exception& ex){ std::string ex_class = demangle( typeid(ex).name() ) ; std::string ex_msg = ex.what() ; SEXP cppstack = PROTECT( rcpp_get_stack_trace() ) ; SEXP call = PROTECT( get_last_call() ) ; SEXP classes = PROTECT( get_exception_classes(ex_class) ) ; SEXP condition = PROTECT( make_condition( ex_msg, call, cppstack, classes ) ) ; rcpp_set_stack_trace( R_NilValue ) ; UNPROTECT(4) ; return condition ; }