Skip to content

Commit

Permalink
General comments for review #27
Browse files Browse the repository at this point in the history
make sys.call correct for assert_req_arg
  • Loading branch information
PHS-Meantrix committed Jan 10, 2025
1 parent 32c9668 commit 61c2214
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@
#'
#'
#' @export
assert_required_argument <- function(arg, description) {
assert_required_argument <- function(arg, description) {
arg_name <- deparse(substitute(arg))
if (isFALSE(exists(arg_name))) {
stop(paste(
sprintf("Missing argument: '%s'.", arg_name),
if (!exists(arg_name)) {
stop(simpleError(paste(
sprintf("\n Missing required argument: '%s'.", arg_name),
description,
sep = "\n"
))
sep = "\n "
), sys.call(sys.parent())))
}
}

0 comments on commit 61c2214

Please sign in to comment.