-
Notifications
You must be signed in to change notification settings - Fork 24
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
Informative error messages #16
Comments
This is what we get currently with dev version and > quarto_render("report.qmd", quiet = FALSE)
Error in `quarto_render()`:
! Error running quarto cli:
✖
processing file: report.qmd
|................................... | 67% [unnamed-chunk-1]
Quitting from lines 8-9 [unnamed-chunk-1] (report.qmd)
Error:
! true message
Exécution arrêtée
++ Activating rlang global_entrace
Caused by error:
! System command 'quarto.exe' failed
Run `rlang::last_trace()` to see where the error occurred. When > quarto render .\report.qmd --quiet
> echo $LASTEXITCODE
1
> quarto render .\report.qmd
processing file: report.qmd
|................................... | 67% [unnamed-chunk-1]
Quitting from lines 8-9 [unnamed-chunk-1] (report.qmd)
Error:
! true message
Exécution arrêtée So this is probably the same as #126 and we should indeed advice to re-run with |
After 0985e12 this is what we get (when also rlang backtrace are activated) lines <- c(
"---",
"title: 'error'",
"format: html",
"editor: source",
"---",
"",
"```{r}",
"stop('true message')",
"```"
)
writeLines(lines, "report.qmd")
quarto_render("report.qmd", quiet = TRUE)
#> Error in `quarto_render()`:
#> ! Error running quarto cli:
#> ℹ Rerun with `quiet = FALSE` to see the full error message.
#> Caused by error:
#> ! System command 'quarto.exe' failed
#> Backtrace:
#> ▆
#> 1. └─quarto::quarto_render("report.qmd", quiet = TRUE)
#> 2. └─quarto:::quarto_run(args, echo = TRUE, quarto_bin = quarto_bin) at quarto-r/R/render.R:184:3
#> 3. └─base::tryCatch(...) at quarto-r/R/quarto.R:42:3
#> 4. └─base (local) tryCatchList(expr, classes, parentenv, handlers)
#> 5. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
#> 6. └─value[[3L]](cond)
#> 7. └─rlang::abort(msg, call = .call, parent = e) at quarto-r/R/quarto.R:49:7
quarto_render("report.qmd", quiet = FALSE)
#> Error in `quarto_render()`:
#> ! Error running quarto cli:
#> ✖ ++ Activating rlang global_entrace
#>
#>
#>
#> processing file: report.qmd
#> | | | 0% | |................. | 33% | |................................... | 67% [unnamed-chunk-1]
#>
#>
#> Quitting from lines 8-9 [unnamed-chunk-1] (report.qmd)
#> Error:
#> ! true message
#>
#> Exécution arrêtée
#> ++ Activating rlang global_entrace
#>
#> Caused by error:
#> ! System command 'quarto.exe' failed
#> Backtrace:
#> ▆
#> 1. └─quarto::quarto_render("report.qmd", quiet = FALSE)
#> 2. └─quarto:::quarto_run(args, echo = TRUE, quarto_bin = quarto_bin) at quarto-r/R/render.R:184:3
#> 3. └─base::tryCatch(...) at quarto-r/R/quarto.R:42:3
#> 4. └─base (local) tryCatchList(expr, classes, parentenv, handlers)
#> 5. └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
#> 6. └─value[[3L]](cond)
#> 7. └─rlang::abort(msg, call = .call, parent = e) at quarto-r/R/quarto.R:49:7
Hope this is enough. Feel free to ask for more otherwise. |
Thanks! |
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 liketargets
would have an easier time logging and documenting errors. From ropensci/tarchetypes#99.Created on 2022-07-01 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: