Skip to content

Commit

Permalink
Better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Sep 29, 2023
1 parent a13533b commit e0467e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/pin-read-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pin_write <- function(board, x,
check_board(board, "pin_write", "pin")
dots <- list2(...)
if (!is_empty(dots) && is.null(names(dots[1]))) {
cli::cli_abort('The {.arg type} argument must be named, like {.code type = "{dots[[1]]}"}.')
cli::cli_abort('Arguments after the dots `...` must be named, like {.code type = "{dots[[1]]}"}.')
}

if (is.null(name)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/pin-read-write.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pin_write(board, mtcars, name = 1:10, "json")
Condition
Error in `pin_write()`:
! The `type` argument must be named, like `type = "json"`.
! Arguments after the dots `...` must be named, like `type = "json"`.
Code
pin_write(board, mtcars, name = "mtcars", type = "froopy-loops")
Condition
Expand Down

0 comments on commit e0467e7

Please sign in to comment.