Skip to content

Commit aa02b16

Browse files
Patched runOSCommand(... stderr = NA) now produces a warning if the exit code > 0 and there was stderr captured
1 parent 35b5e0c commit aa02b16

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-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-9016
2+
Version: 0.20.0-9017
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/runOSCommand.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ runOSCommand = function(sys.cmd, sys.args = character(0L), stdin = "", stdout =
3131
exit.code = attr(res, "status") %??% 0L
3232
if (is.na(stderr)) {
3333
output_stderr = readLines(stderr_file, warn = FALSE)
34+
if (length(output_stderr) > 0 && exit.code > 0) {
35+
warning(sprintf("%s return with exit code %d and a standard error message:\n%s", sQuote(sys.cmd), exit.code, paste(output_stderr, collapse = "\n")), immediate. = TRUE)
36+
}
3437
} else {
3538
output_stderr = NULL
3639
}

0 commit comments

Comments
 (0)