Skip to content

Commit 7c7a2df

Browse files
authored
Merge 8a5b87a into ab7a359
2 parents ab7a359 + 8a5b87a commit 7c7a2df

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
* Fixed bug that caused stdour/stderr not being read at the end of
66
optimization. (#522)
77

8+
* Fixed issue with handling `NA` as the reported external process
9+
status. (#544, @myshkin)
10+
811
### New features
912

1013
* Default directory changed to `.cmdstan` instead of `.cmdstanr` so that

R/model.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ compile <- function(quiet = TRUE,
513513
},
514514
error_on_status = FALSE
515515
)
516-
if (run_log$status != 0) {
516+
if (is.na(run_log$status) || run_log$status != 0) {
517517
stop("An error occured during compilation! See the message above for more information.",
518518
call. = FALSE)
519519
}
@@ -676,7 +676,7 @@ check_syntax <- function(pedantic = FALSE,
676676
},
677677
error_on_status = FALSE
678678
)
679-
if (run_log$status != 0) {
679+
if (is.na(run_log$status) || run_log$status != 0) {
680680
stop("Syntax error found! See the message above for more information.",
681681
call. = FALSE)
682682
}

R/run.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ CmdStanRun$set("private", name = "run_variational_", value = .run_other)
499499
stdout = stdout_file,
500500
error_on_status = FALSE
501501
)
502-
if (ret$status != 0) {
502+
if (is.na(ret$status) || ret$status != 0) {
503503
if (file.exists(stdout_file)) {
504504
cat(readLines(stdout_file), sep = "\n")
505505
}

0 commit comments

Comments
 (0)