You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, any callback registered with OnUnhandledError will trigger regardless of where the error occurs or where the callback is registered.
library(shiny)
mod_ui <- function(id) {
ns <- NS(id)
uiOutput(ns("sess"))
}
mod_server <- function(input, output, session) {
onUnhandledError(function(err) {
# log the unhandled error
print("inner handler")
}, session = session)
output$sess <- renderUI({
# comment this stop out to see how it works when error is outside module
stop("error msg")
})
}
# Define UI for application that draws a histogram
ui <- fluidPage(
mod_ui("test") , uiOutput("sess")
)
# Define server logic required to draw a histogram
server <- function(input, output, session) {
onUnhandledError(function(err) {
# log the unhandled error
print("outer handlers")
}, session = session)
callModule(mod_server, "test")
output$sess <- renderUI({
stop("another error msg")
})
}
# Run the application
shinyApp(ui = ui, server = server)
Regardless of whether the error takes place inside or outside the module both callbacks trigger.
Based on comment here it seems scoping the callbacks to modules would be possible with some updates to session_proxy.
My goal is to use this to create a wrapper of callModule that imitates purrr::safely but reactively so I can call a 3rd party module, and capture an error in the child reactive environment.
The text was updated successfully, but these errors were encountered:
Currently, any callback registered with
OnUnhandledError
will trigger regardless of where the error occurs or where the callback is registered.Regardless of whether the error takes place inside or outside the module both callbacks trigger.
Based on comment here it seems scoping the callbacks to modules would be possible with some updates to
session_proxy
.My goal is to use this to create a wrapper of
callModule
that imitatespurrr::safely
but reactively so I can call a 3rd party module, and capture an error in the child reactive environment.The text was updated successfully, but these errors were encountered: