MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / exception_to_condition_template

Function exception_to_condition_template

inst/include/Rcpp/exceptions.h:334–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332
333template <typename Exception>
334inline SEXP exception_to_condition_template( const Exception& ex, bool include_call) {
335#ifndef RCPP_NO_RTTI
336 std::string ex_class = demangle( typeid(ex).name() ) ;
337#else
338 std::string ex_class = "<not available>";
339#endif
340 std::string ex_msg = ex.what() ;
341
342 Rcpp::Shelter<SEXP> shelter;
343 SEXP call, cppstack;
344 if (include_call) {
345 call = shelter(get_last_call());
346 cppstack = shelter(rcpp_get_stack_trace());
347 } else {
348 call = R_NilValue;
349 cppstack = R_NilValue;
350 }
351 SEXP classes = shelter( get_exception_classes(ex_class) );
352 SEXP condition = shelter( make_condition( ex_msg, call, cppstack, classes) );
353 rcpp_set_stack_trace( R_NilValue ) ;
354 return condition ;
355}
356
357inline SEXP rcpp_exception_to_r_condition(const Rcpp::exception& ex) {
358 ex.copy_stack_trace_to_r();

Callers 2

exception_to_r_conditionFunction · 0.85

Calls 7

demangleFunction · 0.85
get_last_callFunction · 0.85
get_exception_classesFunction · 0.85
make_conditionFunction · 0.85
rcpp_get_stack_traceFunction · 0.70
rcpp_set_stack_traceFunction · 0.70
whatMethod · 0.45

Tested by

no test coverage detected