Is there a way to capture when a shiny application crashes/disconnects (i.e.: closes WebSocket connection) along with its traceback ~ message.
library(shiny)
ui <- fluidPage(
actionButton("crash", "Crash")
)
server <- function(input, output, session) {
session$onEnded(function(){
print(warnings()) # nothing
print(traceback()) # NULL
print(shiny:::.globals$deepStack) # NULL
})
observeEvent(input$crash, {
print(error) # no error object: disconnects
})
}
shinyApp(ui, server)
Nothing I tried worked (see above).
It seems {shiny} does a lot of manipulation of the stacktrace, perhaps that is the reason?