Skip to content

Commit

Permalink
prefix cli::cli_abort
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Apr 20, 2024
1 parent 78a152b commit 2017bdf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions R/slap.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ slap <- function(expr, message, env = caller_env(), keep_parent = TRUE) {
withCallingHandlers(
{{ expr }},
error = function(err) {

message <- {{ message }}
if (is.function(message)) {
message <- message(err)
Expand All @@ -49,7 +48,7 @@ slap <- function(expr, message, env = caller_env(), keep_parent = TRUE) {
error_call <- env$error_call
}

cli_abort(message, parent = if (keep_parent) err, call = error_call)
cli::cli_abort(message, parent = if (keep_parent) err, call = error_call)
}
)
)
Expand Down

0 comments on commit 2017bdf

Please sign in to comment.