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

Added support for throwing exceptions without call stacks. #663

Merged
merged 1 commit into from Apr 11, 2017

Conversation

Projects
None yet
4 participants
@jimhester
Contributor

jimhester commented Apr 3, 2017

There is currently no way to generate an exception from Rcpp which does not have an attached R (and cpp) call stacks. This extra information can be confusing for users, so it is useful to be able to disable it if desired (like stop(call. = FALSE) does in R code.

This could be implemented by providing overloaded forward_exception_to_r()and exception_to_r_condition() functions for Rcpp::exceptions, but I felt like it made the intention more clear to define new functions instead.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
Member

eddelbuettel commented Apr 3, 2017

Did you see Contributing.md ?

@jimhester

This comment has been minimized.

Show comment
Hide comment
@jimhester

jimhester Apr 3, 2017

Contributor

Yes, but not until this was already implemented, since it was already done might as well look at the code

Contributor

jimhester commented Apr 3, 2017

Yes, but not until this was already implemented, since it was already done might as well look at the code

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Apr 3, 2017

Codecov Report

Merging #663 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #663   +/-   ##
=======================================
  Coverage   92.91%   92.91%           
=======================================
  Files          65       65           
  Lines        3303     3303           
=======================================
  Hits         3069     3069           
  Misses        234      234
Impacted Files Coverage Δ
inst/include/Rcpp/exceptions.h 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 886f5df...a15ba45. Read the comment docs.

codecov-io commented Apr 3, 2017

Codecov Report

Merging #663 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #663   +/-   ##
=======================================
  Coverage   92.91%   92.91%           
=======================================
  Files          65       65           
  Lines        3303     3303           
=======================================
  Hits         3069     3069           
  Misses        234      234
Impacted Files Coverage Δ
inst/include/Rcpp/exceptions.h 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 886f5df...a15ba45. Read the comment docs.

@jimhester jimhester closed this Apr 4, 2017

@eddelbuettel eddelbuettel reopened this Apr 9, 2017

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel Apr 9, 2017

Member

Meant to reopen this earlier after we all seemed to have reached consensus on #664, but got sidetracked.

Member

eddelbuettel commented Apr 9, 2017

Meant to reopen this earlier after we all seemed to have reached consensus on #664, but got sidetracked.

@eddelbuettel

This comment has been minimized.

Show comment
Hide comment
@eddelbuettel

eddelbuettel Apr 10, 2017

Member

This looks fine to me. Any other takers?

Member

eddelbuettel commented Apr 10, 2017

This looks fine to me. Any other takers?

@kevinushey

This comment has been minimized.

Show comment
Hide comment
@kevinushey

kevinushey Apr 10, 2017

Contributor

+1

Contributor

kevinushey commented Apr 10, 2017

+1

@eddelbuettel eddelbuettel merged commit 43e53b0 into RcppCore:master Apr 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

eddelbuettel added a commit that referenced this pull request Apr 11, 2017

squashing in commit of #663
commit 43e53b0
Merge: 886f5df a15ba45
Author: Dirk Eddelbuettel <edd@debian.org>
Date:   Tue Apr 11 13:20:10 2017 -0500

    Merge pull request #663 from jimhester/exceptions_without_callstacks

    Added support for throwing exceptions without call stacks.

commit a15ba45
Author: Jim Hester <james.f.hester@gmail.com>
Date:   Mon Apr 3 16:11:24 2017 -0400

    Added support for throwing exceptions without call stacks.

michaelweylandt added a commit to michaelweylandt/Rcpp that referenced this pull request Mar 5, 2018

Allow Rcpp::stop and Rcpp::warning to be called without call info
- Add include_call argument to Rcpp::stop and Rcpp::warning
  (default true for back-compatability)
- In Rcpp::stop, forward to Rcpp::exception constructor
  (support added in #663)
- In Rcpp::warning, call Rf_warningcall(R_NilValue, ...)
  if include_call = FALSE to suppress caller info

michaelweylandt added a commit to michaelweylandt/Rcpp that referenced this pull request Mar 5, 2018

Allow Rcpp::stop and Rcpp::warning to be called without call info
- Add include_call argument to Rcpp::stop and Rcpp::warning
  (default true for back-compatability)
- In Rcpp::stop, forward to Rcpp::exception constructor
  (support added in #663)
- In Rcpp::warning, call Rf_warningcall(R_NilValue, ...)
  if include_call = FALSE to suppress caller info

michaelweylandt added a commit to michaelweylandt/Rcpp that referenced this pull request Mar 5, 2018

Allow Rcpp::stop and Rcpp::warning to be called without call info
- Add include_call argument to Rcpp::stop and Rcpp::warning
  (default true for back-compatability)
- In Rcpp::stop, forward to Rcpp::exception constructor
  (support added in #663)
- In Rcpp::warning, call Rf_warningcall(R_NilValue, ...)
  if include_call = FALSE to suppress caller info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment