Skip to content

Commit

Permalink
chore: adding more informative error message for Stan users who forge…
Browse files Browse the repository at this point in the history
…t to specify .model_type and stumble into find_nonmem_file()
  • Loading branch information
seth127 committed Feb 24, 2021
1 parent fbc1c82 commit 5c05a69
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/get-path-from-object.R
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,15 @@ find_nonmem_model_file_path <- function(.path, .check_exists = TRUE) {

if (!any(exists_idx)) {
if (isTRUE(.check_exists)) {
stop(
glue::glue(
stop(paste(
glue(
"No model file found at {maybe_paths[1L]} or {maybe_paths[2L]}.",
"Please put relevant model file in that location.",
.sep = " "
)
)
),
"IF THIS IS NOT A NONMEM MODEL please pass the appropriate type to `.model_type`",
sep = "\n"
))
} else {
res <- maybe_paths[1L]
}
Expand Down

0 comments on commit 5c05a69

Please sign in to comment.