Skip to content

feat(errors): Use rlang and cli for error and warning messages - #164

Draft
schloerke wants to merge 1 commit into
schloerke/160-pkgdown-referencefrom
schloerke/160-rlang-cli-errors
Draft

schloerke wants to merge 1 commit into
schloerke/160-pkgdown-referencefrom
schloerke/160-rlang-cli-errors

Conversation

@schloerke

@schloerke schloerke commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Uses rlang and cli for the package's own errors and warnings. assert_shiny_version() now calls rlang::check_installed("shiny", version = ...), which also offers to install or upgrade shiny in an interactive session. reactlog_show() and reactlog_widget() check for shiny when called with the default log, instead of failing with "there is no package called 'shiny'". reactlog_render() uses rlang::is_installed() in place of requireNamespace().

reactlog_disable() and the log version checks now use cli::cli_abort() / cli::cli_warn() with bullets. The version errors are reported from the function the user called (such as reactlog_render()), not the internal reactlog_upgrade(). cli is added to Imports.

Adds snapshot tests for the new messages, so the package now uses testthat's 3rd edition (Config/testthat/edition: 3). Stacked on #162.

Check for shiny with rlang::check_installed(), including when
reactlog_show() or reactlog_widget() use the default log. Use
cli::cli_abort() and cli::cli_warn() for reactlog_disable() and log
version errors, and report them from the function the user called.
Switch to testthat 3rd edition for snapshot tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant