Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

Feature: option to capture exact "console error" #349

Open barboulotte opened 3 years ago

barboulotte commented 3 years ago

Related question on SO: https://stackoverflow.com/questions/66603676/capture-error-messages-as-character-string-in-r/66660202

See also https://github.com/r-lib/evaluate/issues/101

Would it be possible to capture exact "console error":

5 5
#> Error: unexpected numeric constant in "5 5"

message(paste("Error:", pander::evals("5 5")[[1]]$msg$errors))
#> Error: Unexpected numeric constant at character 3 in line 1: ` 5 5`

Thank you,