From 98442f928c987ef377ac2adf9fb0e1e01edcf1c9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 11 Jul 2024 11:21:59 +0200 Subject: [PATCH] typo --- R/utils.R | 2 +- tests/testthat/test-helper.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/utils.R b/R/utils.R index 12a14fa3b..ee26d166e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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) diff --git a/tests/testthat/test-helper.R b/tests/testthat/test-helper.R index e9d2728a0..8b39b20e0 100644 --- a/tests/testthat/test-helper.R +++ b/tests/testthat/test-helper.R @@ -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)