Skip to content

Commit

Permalink
rmarkdown error tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jayhesselberth committed Nov 26, 2023
1 parent 26cbffb commit 9e2a9e2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/rmarkdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ render_rmarkdown <- function(pkg, input, output, ..., copy_images = TRUE, quiet
output_path <- path_abs(output, pkg$dst_path)

if (!file_exists(input_path)) {
cli::cli_abort("Can't find {.file {src_path(input)}")
cli::cli_abort("Can't find {src_path(input)")
}

cli::cli_alert_info("Reading {src_path(input)}")
Expand Down Expand Up @@ -38,9 +38,10 @@ render_rmarkdown <- function(pkg, input, output, ..., copy_images = TRUE, quiet
)
),
error = function(cnd) {
cli::cli_h2("RMarkdown error")
cat(gsub("\r", "", cnd$stderr, fixed = TRUE))
cli::cli_abort("Failed to render RMarkdown")
cli::cli_abort(c(
"Failed to render RMarkdown document",
"x" = cat(gsub("\r", "", cnd$stderr, fixed = TRUE))
))
}
)

Expand Down

0 comments on commit 9e2a9e2

Please sign in to comment.