Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 11, 2024
1 parent cc8a236 commit 98442f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# small wrapper around this commonly used try-catch
.safe <- function(code, on_error = NULL) {
if (getOption("easystats_erros", FALSE) && is.null(on_error)) {
if (getOption("easystats_errors", FALSE) && is.null(on_error)) {
code
} else {
tryCatch(code, error = function(e) on_error)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-helper.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
skip_on_cran()
skip_if_not_installed("withr")
withr::with_options(
list(easystats_erros = TRUE),
list(easystats_errors = TRUE),
test_that(".safe works with options", {
expect_error(parameters:::.safe(mean(fd)), regex = "object 'fd' not found")
expect_identical(parameters:::.safe(mean(fd), 1L), 1L)
Expand Down

0 comments on commit 98442f9

Please sign in to comment.