Report the error for the supplied error code that is assumed to occur within the named function. Then provide a stack trace for the calling thread and terminate execution of the program. Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hzexit | (hzEcode,const char*,) |
Declared in file: hzProcess.h
Defined in file : hzError.cpp
Function Logic:
Function body:
void hzexit (hzEcode eError)const char* va_alist,
{
// Report the error for the supplied error code that is assumed to occur within the named function. Then provide a stack trace for the calling thread and terminate execution
// of the program.
//
// Arguments: 1) eError Error code
// 2) va_alist Error description
//
// Returns: None
va_list ap1 ; // Variable argument list
hzChain E ; // Error chain
hzLogger* pLog ; // Output logfile
hzProcess* phz ; // Process controller
const char* fmt ; // Format control string
if (_hzGlobal_kill)
return ;
phz = GetThreadInfo() ;
if (!phz)
{
printf("No process - hzexit called\n") ;
exit(eError.Value()) ;
}
_hzGlobal_kill = true ;
_makeErrmsg(E, HZ_FATAL, eError) ;
va_start(ap1, va_alist) ;
fmt = va_alist ;
E._vainto(fmt, ap1) ;
va_end(ap1) ;
E.AddByte(CHAR_NL) ;
pLog = GetThreadLogger() ;
if (!pLog)
std::cerr << E ;
else
{
if (pLog->IsOpen())
pLog->Out(E) ;
else
std::cerr << E ;
}
phz->StackTrace() ;
exit(eError.Value()) ;
}