Skip to content

Commit

Permalink
add defensive programming #32
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpelu committed Oct 15, 2024
1 parent 50d7aac commit bbeaa13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/launch_famexplorer.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ launch_famexplorer <- function() {
if (appDir == "") {
stop("Could not find app directory. Try re-installing `famexploreR`.", call. = FALSE)
}

if (!dir.exists(appDir)) {
stop(paste("Error: The application directory does not exist:", appDir))
}

if (!requireNamespace("shiny", quietly = TRUE)) {
stop("Error: The 'shiny' package is not installed. Please install it before proceeding.")
}

# Run app
shiny::runApp(appDir, display.mode = "normal", launch.browser = TRUE)
}

0 comments on commit bbeaa13

Please sign in to comment.