Skip to content

Commit

Permalink
Tweak error wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Nov 6, 2024
1 parent d3c16cd commit acc5cf8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/expect-condition.R
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ cnd_matcher <- function(base_class,
grepl(pattern, conditionMessage(x), ...),
error = function(e) {
cli::cli_abort(
"Failed to compare message to {.arg pattern}.",
"Failed to compare {base_class} to {.arg pattern}.",
parent = e,
call = error_call
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/expect-condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
expect_condition(stop("Hi!"), "x", foo = "bar")
Condition
Error in `expect_condition()`:
! Failed to compare message to `pattern`.
! Failed to compare condition to `pattern`.
Caused by error in `grepl()`:
! unused argument (foo = "bar")

0 comments on commit acc5cf8

Please sign in to comment.