tidyverse / purrr

A functional programming toolkit for R
https://purrr.tidyverse.org/
Other
1.28k stars 272 forks source link

`purrr:::capture_output()` should use `conditionMessage()` not `$message` #1010

Closed DavisVaughan closed 1 year ago

DavisVaughan commented 1 year ago
> purrr:::capture_output
function (code) 
{
    warnings <- character()
    wHandler <- function(w) {
        warnings <<- c(warnings, w$message)
        invokeRestart("muffleWarning")
    }
    messages <- character()
    mHandler <- function(m) {
        messages <<- c(messages, m$message)
        invokeRestart("muffleMessage")
    }

To give things like rlang:::conditionMessage.rlang_error a chance to run correctly