diff --git a/R/render.R b/R/render.R index 4dfafaa52..64b046a01 100644 --- a/R/render.R +++ b/R/render.R @@ -212,9 +212,9 @@ check_open_graph_list <- function(x, if (is.list(x) || is.null(x)) { return() } - not <- friendly_type_of(x) cli::cli_abort( - "{.file {file_path}}: {.field {error_path}} must be a list, not {not}.", + "{.file {file_path}}: {.field {error_path}} must be a list, + not {.obj_type_friendly {x}}.", call = error_call ) } diff --git a/tests/testthat/_snaps/render.md b/tests/testthat/_snaps/render.md index 7e4715fd0..e4ab0a4f6 100644 --- a/tests/testthat/_snaps/render.md +++ b/tests/testthat/_snaps/render.md @@ -82,7 +82,7 @@ check_open_graph_(list(twitter = 1)) Condition Error in `check_open_graph_()`: - ! '_pkgdown.yml': template.opengraph.twitter must be a list, not a double vector. + ! '_pkgdown.yml': template.opengraph.twitter must be a list, not a number. Code check_open_graph_(list(twitter = list())) Condition @@ -92,5 +92,5 @@ check_open_graph_(list(image = 1)) Condition Error in `check_open_graph_()`: - ! '_pkgdown.yml': template.opengraph.image must be a list, not a double vector. + ! '_pkgdown.yml': template.opengraph.image must be a list, not a number.