As part of doing the rev dep checks for dplyr 1.0.8 tidyverse/dplyr#6080 there are some packages that start to fail because expect_error() does not match the pattern, because the message is now in a parent condition.
library(testthat)
library(rlang)
#>
#> Attaching package: 'rlang'
#> The following objects are masked from 'package:testthat':
#>
#> is_false, is_null, is_true
f <- function() {
abort("hello")
}
g <- function() {
withCallingHandlers(f(), error = function(cnd) {
abort("bonjour", parent = cnd)
})
}
expect_error(g(), "Hello")
#> Error: `g()` threw an error with unexpected message.
#> Expected match: "Hello"
#> Actual message: "bonjour"
tryCatch(g(), error= print)
#> <error/rlang_error>
#> Error:
#> bonjour
#> Caused by error in `f()`:
#> hello
#> Backtrace:
#> 1. base::tryCatch(g(), error = print)
#> 5. global g()
#> 7. global f()
Created on 2021-11-17 by the reprex package (v2.0.1.9000)
As part of doing the rev dep checks for dplyr 1.0.8 tidyverse/dplyr#6080 there are some packages that start to fail because
expect_error()does not match the pattern, because the message is now in a parent condition.Created on 2021-11-17 by the reprex package (v2.0.1.9000)