Skip to content

Commit

Permalink
Add more detail in comment for why we don't throw an error for checke…
Browse files Browse the repository at this point in the history
…r function missing `stage` in its signature
  • Loading branch information
rossellhayes committed Nov 16, 2021
1 parent 368cc8f commit 5b36cf1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/exercise.R
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,10 @@ try_checker <- function(
# Throw better error messaging if the checker function signature is ill-defined
missing_args <- setdiff(names(args), checker_args)
if (length(missing_args) && !"..." %in% checker_args) {
# Don't throw an error if the only missing argument is `stage`
if (identical(missing_args, "stage")) {
# Don't throw an error if the only missing argument is `stage`.
# `stage` was not available in learnr <= 0.10.1 and checker functions can
# still work without it.
args <- args[names(args) != "stage"]
} else {
msg <- sprintf(
Expand Down

0 comments on commit 5b36cf1

Please sign in to comment.