Example code that exercises different bits of weirdness / brokenness: ``` cpp #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] void ouch() { stop("ouch"); } // [[Rcpp::export]] void exec(Function f) { f(); } /*** R ## Fails (no error thrown) exec(stop) ## Correct (error is thrown) exec(function() stop("ouch")) ## Correct (error is silenced) try(silent = TRUE, exec(function() stop("ouch"))) ## Correct (error is silenced) exec(function() try(silent = TRUE, stop("ouch"))) ## Fails (error is not silenced) exec(function() try(silent = TRUE, exec(ouch))) ## Fails (error is not silenced) exec(function() try(silent = TRUE, exec(function() stop("ouch")))) */ ``` cc: @jcheng5, https://github.com/rstudio/shiny/issues/879