% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/def.generate.err.msg.R
\name{def.generate.err.msg}
\alias{def.generate.err.msg}
\title{Generate an error message by constructing the info passed into.}
\usage{
def.generate.err.msg(
  errmsg = NULL,
  fun_calling = NULL,
  fun_called = NULL,
  lineNum = NULL
)
}
\arguments{
\item{lineNum}{Number. Can get the line number by the command, getSrcLocation(function() {}, "line")}

\item{Errmsg}{String. Can be NULL if no specific error. 

Requires rlang and utils to run these commands}

\item{fun_calling.}{Can get the function name that is calling by the command, rlang::call_frame(n = 2)$fn_name}

\item{fun_called.}{Can get the function name that is called by the command, rlang::call_frame(n = 1)$fn_name}
}
\value{
Message.
}
\description{
Generate a message starting with an error message. These, function which is calling, function called and line number where the error occurred, are appended. 
And return the message
}
\examples{
Modify the statement below by replacing "Bad Input" with your own error message and run it.
msg <- NEONprocIS.base::def.generate.err.msg(errmsg="Bad input", fun_calling=rlang::call_frame(n = 2)$fn_name, fun_called=rlang::call_frame(n = 1)$fn_name, lineNum=getSrcLocation(function() {}, "line"))
log$error(msg)
stop(msg)
An example output, Error in check(x) : "Bad input" in check near line 4, called by test 
}
\references{
License: (example) GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
}
\seealso{
Currently none
}
\author{
Mija Choi \email{choim@battelleecology.org}
}
\keyword{Currently}
\keyword{none}
