R/message-utils.R

Defines functions .warning .error

#' @title Utility functions
#'
#' @param msg   a `character` string with format error message.
#'
#' @param ...   values to be passed to `msg` parameter.
#'
#' @param class error class name
#'
#' @noRd
.error <- function(msg, ..., class = NULL) {
  stop(errorCondition(sprintf(msg, ...), class = class, call = NULL))
}

#' @title Utility functions
#'
#' @param msg   a `character` string with format warning message.
#'
#' @param ...   values to be passed to `msg` parameter.
#'
#' @noRd
.warning <- function(msg, ...) {
  warning(sprintf(msg, ...), call. = FALSE)
}

Try the rstac package in your browser

Any scripts or data that you put into this service are public.

rstac documentation built on Oct. 18, 2023, 1:15 a.m.