Skip to content

Commit efd56e7

Browse files
committed
improve error message
1 parent 068ca98 commit efd56e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

R/wells.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@ check_wells <- function(wells, format, returnerror = TRUE) {
4949

5050
# Validate plate format
5151
if (!format %in% names(.plateformats)) {
52-
rlang::abort("Invalid plate format. Must be one of '24', '48', '96', or '384'.")
52+
valid_formats <- paste(names(.plateformats), collapse = ", ")
53+
rlang::abort(glue::glue(
54+
"Invalid plate format '{format}'. Valid formats are: {valid_formats}."
55+
))
5356
}
5457

5558
# Ensure wells is a character vector
5659
if (!is.character(wells)) {
57-
rlang::abort("The 'wells' parameter must be a character vector.")
60+
rlang::abort("Invalid 'wells' argument {wells}. The 'wells' argument must be a character vector.")
5861
}
5962

6063
# Identify invalid wells

0 commit comments

Comments
 (0)