[Rcpp-devel] no automatic exception forwarding on windows, can anyone help ?

Romain Francois romain at r-enthusiasts.com
Tue Apr 20 09:47:28 CEST 2010


Hello Rcpp users,

Over the past few days, I have tested Rcpp on windows, and it appears 
that it is not possible to have automatic exception forwarding on this 
platform.

Since Rcpp 0.7.1, we have been using and promoting this feature, but I 
am afraid we are going to have to remove it of it does not work on windows.

The feature is based on installing a custom terminate handler 
(http://www.cplusplus.com/reference/std/exception/set_terminate/) that 
picks up the current exception and forward it to R.

I have tried many things without success, and I was wondering if someone 
here would have a clue.

Short of this feature, we have to switch back to explicit try/catch 
blocks, something like this:

try{
  // some user code
} catch( std::exception& __ex__){
   forward_exception_to_r( __ex__ ) ;
}

where forward_exception_to_r is an Rcpp function that gathers some 
information from the exception (its class and its message).

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/9aKDM9 : embed images in Rd documents
|- http://tr.im/OIXN : raster images and RImageJ
|- http://tr.im/OcQe : Rcpp 0.7.7



More information about the Rcpp-devel mailing list