% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils-internal_warn_sncm.R
\name{.internal_warn_sncm}
\alias{.internal_warn_sncm}
\title{Internal warning handler for sncm.fit likelihood functions}
\usage{
.internal_warn_sncm(fun, message = NULL, warned = FALSE, warn_setter = NULL)
}
\arguments{
\item{fun}{A zero-argument function (lambda) to evaluate.}

\item{message}{A string prefix for the warning message.}

\item{warned}{Logical flag indicating whether a warning has already fired.}

\item{warn_setter}{A zero-argument function that sets the external \code{warned}
flag to \code{TRUE} via \verb{<<-}.}
}
\value{
The result of \code{fun()}.
}
\description{
Wraps a function call with a \code{withCallingHandlers()} that captures warnings
and re-emits them via \code{cli::cli_warn()}. Deduplicates repeated warnings
across optimizer iterations using an external flag and setter.
}
\keyword{internal}
