From e1548054eb21b55aa1e7383f430045989ee52d49 Mon Sep 17 00:00:00 2001 From: Sam El-Kamand Date: Wed, 13 Nov 2024 14:03:44 +1100 Subject: [PATCH] fix: fixed try call in assert_connection docs --- R/assert_type.R | 10 +++++----- man/assert_connection.Rd | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/R/assert_type.R b/R/assert_type.R index be38654..fcff512 100644 --- a/R/assert_type.R +++ b/R/assert_type.R @@ -580,12 +580,12 @@ assert_scalar <- assert_create( #' @return `invisible(TRUE)` if `x` is a valid database connection, otherwise aborts with an error message. #' #' @examples -#' \try{ -#' # Assuming a valid DBI connection `conn`: -#' assert_connection(conn) # Passes if `conn` is a DBI connection +#' try({ +#' # Assuming a valid DBI connection `conn`: +#' assert_connection(conn) # Passes if `conn` is a DBI connection #' -#' assert_connection(42) # Fails with error message -#' } +#' assert_connection(42) # Fails with error message +#' }) #' #' @details #' This function is designed for use with objects inheriting from the "DBIConnection" class, which is used widely across database connection implementations in R. diff --git a/man/assert_connection.Rd b/man/assert_connection.Rd index 137ddfa..d4ef627 100644 --- a/man/assert_connection.Rd +++ b/man/assert_connection.Rd @@ -28,12 +28,12 @@ This function is designed for use with objects inheriting from the "DBIConnectio As other database interface packages are introduced, additional checks may be added to support other connection classes. } \examples{ -\try{ -# Assuming a valid DBI connection `conn`: -assert_connection(conn) # Passes if `conn` is a DBI connection +try({ + # Assuming a valid DBI connection `conn`: + assert_connection(conn) # Passes if `conn` is a DBI connection -assert_connection(42) # Fails with error message -} + assert_connection(42) # Fails with error message +}) } \concept{assert_type}