% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{.message_or_error}
\alias{.message_or_error}
\title{Message or error}
\usage{
.message_or_error(
  msg,
  error = FALSE,
  call = get_cli_abort_call(),
  envir = rlang::caller_env()
)
}
\arguments{
\item{msg}{(scalar \code{character})\cr
Error message}

\item{error}{(scalar \code{logical})\cr
If this should produce an error or a warning. FALSE by default}

\item{call}{The execution environment of a currently running
function, e.g. \code{call = caller_env()}. The corresponding function
call is retrieved and mentioned in error messages as the source
of the error.

You only need to supply \code{call} when throwing a condition from a
helper function which wouldn't be relevant to mention in the
message.

Can also be \code{NULL} or a \link[rlang:topic-defuse]{defused function call} to
respectively not display any call or hard-code a code to display.

For more information about error calls, see \ifelse{html}{\link[rlang:topic-error-call]{Including function calls in error messages}}{\link[rlang:topic-error-call]{Including function calls in error messages}}.}

\item{envir}{(\code{environment})\cr
Environment to evaluate the glue expressions in passed in \code{cli::cli_abort(message)}.
Default is \code{rlang::current_env()}}
}
\value{
Invisible NULL
}
\description{
Either error or message depending on input.
}
\examples{
\dontrun{
cards:::.message_or_error("This will be a message", FALSE)
cards:::.message_or_error("This will be an error", TRUE)
}
}
\keyword{internal}
