New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Rcpp::exceptions without call stacks #664

Closed
jimhester opened this Issue Apr 4, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@jimhester
Contributor

jimhester commented Apr 4, 2017

I would like to have an API for constructing Rcpp exceptions without call stacks, also potentially also an argument to Rcpp::stop() analogous to stop(call. = FALSE), although the latter is mostly just sugar if you can throw the desired Rcpp exception manually.

You can view a working implementation of this is at master...jimhester:exceptions_without_callstacks

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel Apr 4, 2017

Member

So when I call stop() I get something like

R> cppFunction('void loudStop() { stop("Boom"); }')
R> loudStop()
Error in loudStop() : Boom
R> 
R> anotherLayer <- function() loudStop()
R> anotherLayer()
Error in loudStop() (from #1) : Boom
R> 

Do I understand you correctly that you just want to see Boom ?

Member

eddelbuettel commented Apr 4, 2017

So when I call stop() I get something like

R> cppFunction('void loudStop() { stop("Boom"); }')
R> loudStop()
Error in loudStop() : Boom
R> 
R> anotherLayer <- function() loudStop()
R> anotherLayer()
Error in loudStop() (from #1) : Boom
R> 

Do I understand you correctly that you just want to see Boom ?

@jimhester

This comment has been minimized.

Show comment
Hide comment
@jimhester

jimhester Apr 4, 2017

Contributor

Yes exactly, this is R equivalent

(function() stop("boom"))()
#> Error in (function() stop("boom"))() : boom

(function() stop("boom", call. = FALSE))()
#> Error: boom
Contributor

jimhester commented Apr 4, 2017

Yes exactly, this is R equivalent

(function() stop("boom"))()
#> Error in (function() stop("boom"))() : boom

(function() stop("boom", call. = FALSE))()
#> Error: boom
@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel Apr 4, 2017

Member

I'm in favor. I am a somewhat-recent (a year? two) convert to call.=FALSE which I use more and more.

Member

eddelbuettel commented Apr 4, 2017

I'm in favor. I am a somewhat-recent (a year? two) convert to call.=FALSE which I use more and more.

@coatless

This comment has been minimized.

Show comment
Hide comment
@coatless

coatless Apr 24, 2017

Contributor

This issue ticket can be closed as it was addressed in #663.

Contributor

coatless commented Apr 24, 2017

This issue ticket can be closed as it was addressed in #663.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment