handle exception reporting in RageException

This commit is contained in:
Glenn Maynard
2003-02-14 19:00:37 +00:00
parent 1ea055bf3b
commit b47254c32b
2 changed files with 13 additions and 12 deletions
+13 -1
View File
@@ -39,11 +39,23 @@ void RageException::Throw(const char *fmt, ...)
CString error = vssprintf( fmt, va );
va_end(va);
CString msg = ssprintf(
"\n"
"//////////////////////////////////////////////////////\n"
"Exception: %s\n"
"//////////////////////////////////////////////////////\n"
"",
error.GetString());
if(LOG)
{
LOG->Trace("Fatal exception thrown: %s", error.GetString());
LOG->Trace("%s", msg.GetString());
LOG->Flush();
}
else
{
printf("%s\n", msg.GetString());
fflush(stdout);
}
#if defined(WIN32) && defined(DEBUG)
MessageBox( NULL, error, "Fatal Error", MB_OK );
-11
View File
@@ -342,17 +342,6 @@ int main(int argc, char* argv[])
catch( RageException e )
{
g_sErrorString = e.what();
LOG->Trace(
"\n"
"//////////////////////////////////////////////////////\n"
"Exception: %s\n"
"//////////////////////////////////////////////////////\n"
"\n",
g_sErrorString.GetString()
);
LOG->Flush();
}
#endif