Skip to main content

rf_error

Function rf_error 

Source
pub unsafe fn rf_error(msg: &str) -> !
Expand description

Raise an R error with the given message.

This is a thin wrapper around Rf_error for use in method shims. It never returns (diverges to R’s error handler).

§Arguments

  • msg - Error message to display

§Safety

  • Must be called on R’s main thread
  • Never returns (uses R’s Rf_error which longjmps)

§Example

if argc != 2 {
    unsafe { rf_error("expected 2 arguments, got {argc}"); }
}