Skip to main content

with_r_unwind_protect_error_in_r

Function with_r_unwind_protect_error_in_r 

Source
pub fn with_r_unwind_protect_error_in_r<F>(f: F, call: Option<SEXP>) -> SEXP
where F: FnOnce() -> SEXP,
Expand description

Like with_r_unwind_protect, but returns a tagged error SEXP on Rust panics instead of raising an R error via Rf_errorcall.

Used by #[miniextendr(error_in_r)] mode for the main thread strategy. The error SEXP is inspected by the generated R wrapper which raises a proper R error condition past the Rust boundary.

R-origin errors (longjmp) still pass through via R_ContinueUnwind.