Skip to contents

Wraps tryCatch() around an expression so that an error raised by a computation (e.g. runPCA() or run_clustering() rejecting degenerate input) surfaces as a validate message in the UI rather than crashing the app.

Usage

validate_or_catch(expr)

Arguments

expr

Expression to evaluate

Value

output Result of expr, or triggers a Shiny validation error with the original condition's message

Examples

validate_or_catch(1 + 1)
#> [1] 2