@@ -309,8 +309,7 @@ loggedError.BatchtoolsFuture <- function(future, ...) {
309309 if (is_na(stat )) return (NULL )
310310
311311 if (! finished(future )) {
312- label <- future $ label
313- if (is.null(label )) label <- " <none>"
312+ label <- sQuoteLabel(future )
314313 msg <- sprintf(" %s ('%s') has not finished yet" , class(future )[1L ], label )
315314 stop(BatchtoolsFutureError(msg , future = future ))
316315 }
@@ -335,8 +334,7 @@ loggedOutput.BatchtoolsFuture <- function(future, ...) {
335334 if (is_na(stat )) return (NULL )
336335
337336 if (! finished(future )) {
338- label <- future $ label
339- if (is.null(label )) label <- " <none>"
337+ label <- sQuoteLabel(future )
340338 msg <- sprintf(" %s ('%s') has not finished yet" , class(future )[1L ], label )
341339 stop(BatchtoolsFutureError(msg , future = future ))
342340 }
@@ -356,8 +354,6 @@ loggedOutput.BatchtoolsFuture <- function(future, ...) {
356354# ' @export
357355# ' @keywords internal
358356resolved.BatchtoolsFuture <- function (x , ... ) {
359- signalEarly <- import_future(" signalEarly" )
360-
361357 # # Is value already collected?
362358 if (! is.null(x $ result )) {
363359 # # Signal conditions early?
@@ -413,8 +409,7 @@ result.BatchtoolsFuture <- function(future, cleanup = TRUE, ...) {
413409 if (debug ) mdebug(" - getting batchtools status" )
414410 stat <- status(future )
415411 if (is_na(stat )) {
416- label <- future $ label
417- if (is.null(label )) label <- " <none>"
412+ label <- sQuoteLabel(future )
418413 stopf(" The result no longer exists (or never existed) for Future ('%s') of class %s" , label , paste(sQuote(class(future )), collapse = " , " )) # nolint
419414 }
420415
@@ -442,8 +437,7 @@ result.BatchtoolsFuture <- function(future, cleanup = TRUE, ...) {
442437# ' @export
443438run.BatchtoolsFuture <- function (future , ... ) {
444439 if (future $ state != " created" ) {
445- label <- future $ label
446- if (is.null(label )) label <- " <none>"
440+ label <- sQuoteLabel(future )
447441 msg <- sprintf(" A future ('%s') can only be launched once." , label )
448442 stop(FutureError(msg , future = future ))
449443 }
@@ -581,8 +575,7 @@ run.BatchtoolsFuture <- function(future, ...) {
581575 })
582576 }, error = function (ex ) {
583577 msg <- conditionMessage(ex )
584- label <- future $ label
585- if (is.null(label )) label <- " <none>"
578+ label <- sQuoteLabel(future )
586579 msg <- sprintf(" Failed to submit %s (%s). The reason was: %s" , class(future )[1 ], label , msg )
587580 info <- capture.output(str(resources ))
588581 info <- paste(info , collapse = " \n " )
@@ -649,8 +642,7 @@ await <- function(future, cleanup = TRUE,
649642 result <- NULL
650643 if (finished ) {
651644 mdebug(" Results:" )
652- label <- future $ label
653- if (is.null(label )) label <- " <none>"
645+ label <- sQuoteLabel(future )
654646 if (" finished" %in% stat ) {
655647 if (debug ) mdebug(" - batchtools::loadResult() ..." )
656648 result <- loadResult(reg = reg , id = jobid )
@@ -780,8 +772,7 @@ delete.BatchtoolsFuture <- function(future,
780772 if (! resolved(future )) {
781773 if (onRunning == " skip" ) return (invisible (TRUE ))
782774 status <- status(future )
783- label <- future $ label
784- if (is.null(label )) label <- " <none>"
775+ label <- sQuoteLabel(future )
785776 msg <- sprintf(" Will not remove batchtools registry, because is appears to hold a non-resolved future (%s; state = %s; batchtools status = %s): %s" , sQuote(label ), sQuote(future $ state ), paste(sQuote(status ), collapse = " , " ), sQuote(path )) # nolint
786777 mdebugf(" delete(): %s" , msg )
787778 if (onRunning == " warning" ) {
0 commit comments