handle exception reporting in RageException
This commit is contained in:
@@ -39,11 +39,23 @@ void RageException::Throw(const char *fmt, ...)
|
|||||||
CString error = vssprintf( fmt, va );
|
CString error = vssprintf( fmt, va );
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
|
CString msg = ssprintf(
|
||||||
|
"\n"
|
||||||
|
"//////////////////////////////////////////////////////\n"
|
||||||
|
"Exception: %s\n"
|
||||||
|
"//////////////////////////////////////////////////////\n"
|
||||||
|
"",
|
||||||
|
error.GetString());
|
||||||
if(LOG)
|
if(LOG)
|
||||||
{
|
{
|
||||||
LOG->Trace("Fatal exception thrown: %s", error.GetString());
|
LOG->Trace("%s", msg.GetString());
|
||||||
LOG->Flush();
|
LOG->Flush();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%s\n", msg.GetString());
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && defined(DEBUG)
|
#if defined(WIN32) && defined(DEBUG)
|
||||||
MessageBox( NULL, error, "Fatal Error", MB_OK );
|
MessageBox( NULL, error, "Fatal Error", MB_OK );
|
||||||
|
|||||||
@@ -342,17 +342,6 @@ int main(int argc, char* argv[])
|
|||||||
catch( RageException e )
|
catch( RageException e )
|
||||||
{
|
{
|
||||||
g_sErrorString = e.what();
|
g_sErrorString = e.what();
|
||||||
|
|
||||||
LOG->Trace(
|
|
||||||
"\n"
|
|
||||||
"//////////////////////////////////////////////////////\n"
|
|
||||||
"Exception: %s\n"
|
|
||||||
"//////////////////////////////////////////////////////\n"
|
|
||||||
"\n",
|
|
||||||
g_sErrorString.GetString()
|
|
||||||
);
|
|
||||||
|
|
||||||
LOG->Flush();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user