Skip to contents

Evaluates expr, reports success or failure to the console, and turns warnings into non-fatal notices. Used by rstudio_reset_gmc() so a single failing step (e.g. no network for dictionaries) never blocks later steps and never fails silently.

Usage

run_reset_step(label, expr)

Arguments

label

Character scalar describing the step, used in progress output.

expr

Expression to evaluate (wrap multiple statements in { }).

Value

Invisibly returns a list with label, ok (logical), and message (the error message, or NA on success).

Examples

bio:::run_reset_step("A step that works", 1 + 1)
#>  A step that works
bio:::run_reset_step("A step that fails", stop("boom"))
#>  A step that fails failed: boom