-
Notifications
You must be signed in to change notification settings - Fork 38
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
Specific error messages no longer returned #228
Comments
You need to use f2 <- function() {
tryCatch(
callr::r_safe(function() stop("specific message")),
error = function(e) conditionMessage(e)
)
} ❯ cat(f2())
! error in callr subprocess
Caused by error in `(function () …`:
! specific message |
Confirmed. That fixed it. Thanks! f2 <- function() {
tryCatch(
callr::r_safe(function() stop("specific message")),
error = function(e) conditionMessage(e)
)
}
packageVersion("processx")
## [1] ‘3.6.0’
packageVersion("callr")
## [1] ‘3.7.0’
f2()
## [1] "callr subprocess failed: specific message"
pak::pkg_install(c("r-lib/processx", "r-lib/callr"))
packageVersion("processx")
## [1] ‘3.6.0.9000’
packageVersion("callr")
## [1] ‘3.7.0.9000’
f2()
## [1] "! error in callr subprocess\nCaused by error in `(function () ...`:\n! specific message"
cat(f2())
## ! error in callr subprocess
## Caused by error in `(function () ...`:
## ! specific message |
jdblischak
added a commit
to workflowr/workflowr
that referenced
this issue
Jun 16, 2022
Motivated by change to error handling by processx/callr: r-lib/callr#228
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The recent updates to the error handling in the development versions of processx (r-lib/processx#335) and callr (#227) have broken some of my workflowr unit tests. My tests check for specific error messages, but these are no longer propagated via
tryCatch()
. Below is a reproducible example. Would it be possible to restore the previous behavior where the specific error message is retained?The text was updated successfully, but these errors were encountered: