Skip to content

build_manual() failure suppresses informative errors #2478

Open
@billdenney

Description

@billdenney

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 <[email protected]> [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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions