Skip to content

Commit

Permalink
some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Apr 21, 2024
1 parent bad5ca6 commit 9498ce8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
21 changes: 13 additions & 8 deletions R/slap.R
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
#' Slap Operator
#'
#' @inheritParams rlang::eval_tidy
#' @inheritParams cli::cli_abort
#' @param expr An expression or quosure to evaluate carefully
#' @param message A message meant to be formatted by [cli::cli_bullets()]
#'
#' When `expr` generates an error, the `%!%` and `%!!%` operators
#' catch it and embed it in a new error thrown by [cli::cli_abort()]
#' with `message`.
#'
#' When the current environment has an `error_call` object, it is
#' used as the `call` argument of [cli::cli_abort()]
#'
#' @examples
#'
#' g <- function() {
#' stop("ouch")
#' }
#' f <- function(error_call = current_env()) {
#' h <- function(error_call = rlang::caller_env()) {
#' g() %!% "bam"
#' }
#' h <- function() {
#' rlang::local_error_call(quote(foo()))
#'
#' g() %!% "bam"
#' f <- function() {
#' h()
#' }
#'
#' \dontrun{
#' f()
#' h()
#' }
#'
#' @name slap
Expand Down
22 changes: 13 additions & 9 deletions man/slap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9498ce8

Please sign in to comment.