Skip to content

Commit 74edf24

Browse files
Add assertion of internal 'batch.id' with information error message
1 parent 00930ed commit 74edf24

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.20.0-9012
2+
Version: 0.20.0-9013
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/BatchtoolsFutureBackend-class.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,12 @@ status <- function(future, ...) {
540540

541541
## Optionally filter by the scheduler's job ID, if it exists
542542
batch_id <- reg[["status"]][["batch.id"]]
543+
if (!is.null(batch_id)) {
544+
if (!is.character(batch_id) || length(batch_id) != 1L || is.na(batch_id) || !nzchar(batch_id) || !grepl("^[[:digit:].]+$", batch_id)) {
545+
stop(sprintf("Unknown value of 'batch.id': [class=%d] %s", class(batch_id)[1], paste(sQuote(batch_id), collapse = ", ")))
546+
}
547+
}
548+
543549
## Pass this to cluster functions listJobsQueued() and listJobsRunning()
544550
## via an R option, because we cannot pass as an argument.
545551
options(

0 commit comments

Comments
 (0)