From a78893176109746f07a2b63a4112269450da901c Mon Sep 17 00:00:00 2001 From: wlandau Date: Mon, 5 Feb 2024 08:33:08 -0500 Subject: [PATCH] reorder assertions --- R/crew_controller.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/crew_controller.R b/R/crew_controller.R index 4cdb4308..8d010517 100644 --- a/R/crew_controller.R +++ b/R/crew_controller.R @@ -559,6 +559,10 @@ crew_class_controller <- R6::R6Class( throttle = TRUE, controller = NULL ) { + crew_assert( + length(private$.tasks) < 1L, + message = "cannot map() until all prior tasks are completed and popped" + ) crew_assert(substitute, isTRUE(.) || isFALSE(.)) if (substitute) { command <- substitute(command) @@ -655,10 +659,6 @@ crew_class_controller <- R6::R6Class( error %in% c("stop", "warn", "silent"), message = "'error' argument must be \"stop\", \"warn\", or \"silent\"" ) - crew_assert( - length(private$.tasks) < 1L, - message = "cannot map() until all prior tasks are completed and popped" - ) crew_assert(scale, isTRUE(.) || isFALSE(.)) crew_assert(throttle, isTRUE(.) || isFALSE(.)) string <- if_any(save_command, deparse_safe(command), NA_character_)