Skip to contents

Safely wrap expression x such that shiny application does no hang when when the expression raises error.

Usage

safe_observe(
  x,
  env = NULL,
  quoted = FALSE,
  priority = 0L,
  domain = NULL,
  ...,
  error_wrapper = c("none", "notification", "alert")
)

Arguments

x, env, quoted, priority, domain, ...

passed to observe

error_wrapper

handler when error is encountered, choices are 'none', 'notification' (see error_notification), or 'alert' (see error_alert)

Value

'shiny' observer instance

Examples


values <- shiny::reactiveValues(A=1)

obsB <- safe_observe({
  print(values$A + 1)
})