We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Somehow I can't figure out how to "early exit" the withRestarts(tryCatch(...), ...) construct in setReactiveS3() or setShinyReactive():
withRestarts(tryCatch(...), ...)
setReactiveS3()
setShinyReactive()
obj$.value <<- withRestarts( tryCatch( { out <- value() ## Object state updates // obj$.condition <- NULL obj$.has_cached <- TRUE obj$.needs_update <- FALSE out ## For debugging/testing purposes # stop("Intentional update fail"), }, warning = function(cond) { invokeRestart("muffleWarning") }, error = function(cond) { invokeRestart("ReactiveUpdateFailed", cond = cond) } ), muffleWarning = function(cond) { message(cond) invokeRestart("muffleWarning") }, ReactiveUpdateFailed = function(cond) { signal <- FALSE if (!cache) { if (grepl("object.*not found", conditionMessage(cond))) { msg <- paste0("caching disabled -->", conditionMessage(cond)) } else if (grepl("evaluation nested too deeply.*infinite recursion", conditionMessage(cond))) { message(conditionMessage(cond)) msg <- "caching disabled --> infinite recursion" signal <- TRUE } } else { msg <- conditionMessage(cond) } cond <- conditionr::signalCondition( call = substitute( get(x= ID, envir = WHERE, inherits = FALSE), list(ID = obj$.id, WHERE = obj$.where) ), condition = "AbortedReactiveUpdateWithError", msg = c( "Update failed", Reason = msg, ID = obj$.id, UID = obj$.uid, Location = capture.output(where) ), ns = "reactr", type = "error", signal = signal ) ## Transfer condition // obj$.condition <<- cond NULL } )
Improve this
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Somehow I can't figure out how to "early exit" the
withRestarts(tryCatch(...), ...)
construct insetReactiveS3()
orsetShinyReactive()
:Improve this
The text was updated successfully, but these errors were encountered: