Skip to content
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

build_manual() failure suppresses informative errors #2478

Open
billdenney opened this issue Oct 15, 2022 · 1 comment
Open

build_manual() failure suppresses informative errors #2478

billdenney opened this issue Oct 15, 2022 · 1 comment
Labels
feature a feature request or enhancement

Comments

@billdenney
Copy link
Contributor

I have some invalid tex code in a manual (that I'm still trying to track down the exact error). When I tried to run build_manual(), it gives an error:

Error in `value[[3L]]()`:
! Failed to build manual

But, that gives no information on the actual error itself. When I go into the code for build_manual(), it appears to try to cat the e$stdtout, but on Windows, that is missing. The e$stderr appears to have all of the output.

cat(e$stdout)

I think that the fix would either be to print(e) instead of cat(e$stdout) or perhaps it's an issue with callr::rcmd() in Windows not redirecting stderr to stdout correctly.

devtools::create(path = "foo")
#> ✔ Creating 'foo/'
#> ✔ Setting active project to 'C:/Users/wdenn/AppData/Local/Temp/RtmpOkKyEx/reprex-5e2414ea1ba0-bonny-fox/foo'
#> ✔ Creating 'R/'
#> ✔ Writing 'DESCRIPTION'
#> Package: foo
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
#>     license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.2.1
#> ✔ Writing 'NAMESPACE'
#> ✔ Setting active project to '<no active project>'
setwd("foo")
cat(file = "R/myfun.R",
"#' A function
#' \\deqn{w_i = \\frac{\\delta_{time,i-1,i} + \\delta_{time,i,i+1}}{2}}{w_i = (d_time[i-1,i] + d_time[i,i+1])/2}
#' \\deqn{\\delta_{time,i,i+1} = \\begin{cases}0 & i < 1 | i > K \\\\ t_{i+1} - t_i & otherwise\\end{cases}}{d_time = t_[i+1] - t_i, and zero if i < 1 or i > K}
#' @name myfun
NULL")
devtools::build_manual()
#> Error in `value[[3L]]()`:
#> ! Failed to build manual

#> Backtrace:
#>     ▆
#>  1. └─devtools::build_manual()
#>  2.   └─base::tryCatch(...)
#>  3.     └─base (local) tryCatchList(expr, classes, parentenv, handlers)
#>  4.       └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
#>  5.         └─value[[3L]](cond)
#>  6.           └─cli::cli_abort("Failed to build manual")
#>  7.             └─rlang::abort(...)

Created on 2022-10-15 with reprex v2.0.2

@LukasWallrich
Copy link

Just to add to the above: nothing about the error is displayed on Mac OS either - e$stderr is where the information lies.

@jennybc jennybc added the feature a feature request or enhancement label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants