Skip to content

Informative error messages #16

@wlandau

Description

@wlandau

When quarto_render() errors out due to an error in a code chunk, it would be helpful if the condition message were more informative. Tools like targets would have an easier time logging and documenting errors. From ropensci/tarchetypes#99.

lines <- c(
  "---",
  "title: 'error'",
  "format: html",
  "editor: source",
  "---",
  "",
  "```{r}",
  "stop('true message')",
  "```"
)
writeLines(lines, "report.qmd")
tryCatch(
  quarto::quarto_render("report.qmd", quiet = TRUE),
  error = function(condition) {
    print(sprintf("Quarto error message: %s", conditionMessage(condition)))
  }
)
#> [1] "Quarto error message: ! System command 'quarto' failed"

Created on 2022-07-01 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions