On Sun, Feb 6, 2022 at 6:25 PM Kevin Ushey <kevinus...@gmail.com> wrote:
>
> If I tweak your example package code so that all exceptions are caught via a 
> catch (...) {} block, I can see something like:
>
> > uptest::uptest()
> Error in (function ()  : Ouch from R
> Caught some other exception.
>
> The fact that we're still printing the R error message seems undesirable, but 
> it looks like the exception can be caught -- just not via std::exception.

Yes that is also what Iñaki and me alluded to above. But I think this
way, what we are catching is not the R error itself (which seems lost
after it was printed), but rather a token that tells the application
we should let Rcpp unwind all the way back to the R console. Which is
what happens if we don't catch it, then it makes sense. But if we _do_
want to handle the situation in C++, this doesn't give us much to work
with.
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to