suppose I have a function like the one below that acts as a wrapper:
void WriteToLog(std::string message)
{
TLog::GetInstance().LogMessage("Script",message,MSG_INFO);
}
LogMessage raises a TFatalException on an error - ie: when the log file is not open. I will eventually change this to a TGenericException or the like which is nonfatal. But for the moment this is to be a fatal exception.
So what happens if LogMessage raises an exception in its execution by AS? There is a catch wrapper outside of the main execution loop.
WinMain(...){
try
{
...
SetupEngine();
engine->Main();
...
}
catch(TFatalException &e)
{
ShowError();
Terminate();
}
}
And from engine->Main() is where the main while(1) lies, which in turn is calling out to the main AS function which could potentially call the Log function, which is where an exception could be raised.
So - how do I handle this? or is there no need to worry?
Cheers
_S