From 278bd815d79479af648f8968d8b2cf5cc47d9804 Mon Sep 17 00:00:00 2001 From: olivroy Date: Tue, 21 May 2024 09:51:23 -0400 Subject: [PATCH] use cli instead of friendly_type_of --- R/render.R | 4 ++-- tests/testthat/_snaps/render.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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.