Skip to content

Commit

Permalink
use cli instead of friendly_type_of
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed May 21, 2024
1 parent 39ea964 commit 278bd81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

0 comments on commit 278bd81

Please sign in to comment.