From 3e53994b33c36a924dcab3aad38da0182a3eac28 Mon Sep 17 00:00:00 2001 From: athowes Date: Mon, 15 Jul 2024 14:06:45 +0100 Subject: [PATCH] Use cli::cli_abort over stop --- R/defaults.R | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/R/defaults.R b/R/defaults.R index 169926d5a..1069248d6 100644 --- a/R/defaults.R +++ b/R/defaults.R @@ -3,9 +3,10 @@ #' @inheritParams epidist_validate #' @param ... Additional arguments for method. #' @family defaults +#' @importFrom cli cli_abort #' @export epidist_validate.default <- function(data, ...) { - stop( + cli::cli_abort( "No epidist_validate method implemented for the class ", class(data), "\n", "See methods(epidist_validate) for available methods" ) @@ -16,9 +17,10 @@ epidist_validate.default <- function(data, ...) { #' @inheritParams epidist_formula #' @param ... Additional arguments for method. #' @family defaults +#' @importFrom cli cli_abort #' @export epidist_formula.default <- function(data, ...) { - stop( + cli::cli_abort( "No epidist_formula method implemented for the class ", class(data), "\n", "See methods(epidist_formula) for available methods" ) @@ -29,9 +31,10 @@ epidist_formula.default <- function(data, ...) { #' @inheritParams epidist_family #' @param ... Additional arguments for method. #' @family defaults +#' @importFrom cli cli_abort #' @export epidist_family.default <- function(data, ...) { - stop( + cli::cli_abort( "No epidist_family method implemented for the class ", class(data), "\n", "See methods(epidist_family) for available methods" ) @@ -43,9 +46,10 @@ epidist_family.default <- function(data, ...) { #' @inheritParams epidist_prior #' @param ... Additional arguments for method. #' @family defaults +#' @importFrom cli cli_abort #' @export epidist_prior.default <- function(data, ...) { - stop( + cli::cli_abort( "No epidist_prior method implemented for the class ", class(data), "\n", "See methods(epidist_prior) for available methods" ) @@ -56,9 +60,10 @@ epidist_prior.default <- function(data, ...) { #' @inheritParams epidist_stancode #' @param ... Additional arguments for method. #' @family defaults +#' @importFrom cli cli_abort #' @export epidist_stancode.default <- function(data, ...) { - stop( + cli::cli_abort( "No epidist_stancode method implemented for the class ", class(data), "\n", "See methods(epidist_stancode) for available methods" )