'Automatically test if shiny crashes and retrieve error?
I have an app like this:
library(shiny)
ui <- fluidPage(
mainPanel(
textOutput("Query_String")
)
)
server <- function(input, output, session) {
observeEvent(session$clientData$url_search,{
Query <- session$clientData$url_search
output$Query_String <- renderText(Query)
# Long list of operations dependant on the parameters passed in the URL
})
}
shinyApp(ui = ui, server = server)
That takes an URL query as parameter. I have a list with around ~5000 entries for all possible queries that should be accepted by the app and I can run the app iterating through the queries by calling the app via something like this:
runApp(
appDir = "R",
port = 3838,
launch.browser = function(appUrl) {
url <- paste0(appUrl, "/?query")
invisible(.Call("rs_shinyviewer", url, getwd(), "browser", NULL, PACKAGE = "(embedding)"))
},
host = "0.0.0.0"
)
Now my question:
How can I catch which queries may make the app crash?
I have tried wrapping the logic inside the server with a big tryCatch() but that apparently doesnt do anything, neither does wrapping the runApp() with tryCatch() (although this makes sense to me).
Ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
