r-package-error-handling
Languages & FrameworksTeaches how to signal, contextualise, and test errors, warnings, and messages in R packages using rlang and cli. Covers cli_abort, cli_warn, and cli_inform messages built from bullets, inline markup, and pluralization; caller_env and caller_arg so errors name the user-facing function and argument; reusable input checkers; catching and rethrowing with try_fetch, including parent chaining, replacing low-level errors, loop context, and call repair; customising bullet symbols and colours; and testthat snapshot tests. Use when writing, refactoring, or reviewing package code that throws, validates, catches, or tests conditions. Not for interactive session debugging, logging pipelines, or non-R projects.
- Version
- v1.0.0
- Size
- 17 KB
- Updated
- 2026-10-10
$ skilvault read --manual r-package-error-handlingYour client verifies the signature before reading. This explicit manual read is available on every plan. Free automatically loads five chosen skills; paid plans automatically load relevant skills across the library.