method for reporting run-time errors in compiled-to-C++ scripts

This commit is contained in:
Vern Paxson 2021-04-19 16:05:59 -07:00
parent cf79c05e3a
commit 00d66f1ac2
2 changed files with 19 additions and 0 deletions

View file

@ -187,6 +187,21 @@ void Reporter::RuntimeError(const detail::Location* location, const char* fmt, .
throw InterpreterException();
}
void Reporter::CPPRuntimeError(const char* fmt, ...)
{
++errors;
va_list ap;
va_start(ap, fmt);
FILE* out = EmitToStderr(errors_to_stderr) ? stderr : nullptr;
DoLog("runtime error in compiled code", reporter_error, out, nullptr, nullptr, true, true, "", fmt, ap);
va_end(ap);
if ( abort_on_scripting_errors )
abort();
throw InterpreterException();
}
void Reporter::InternalError(const char* fmt, ...)
{
va_list ap;