This commit is contained in:
Glenn Maynard
2006-02-24 03:09:11 +00:00
parent d63e24c167
commit 2b02810758
+14 -14
View File
@@ -17,32 +17,32 @@ void RageException::SetCleanupHandler( void (*pHandler)(const RString &sError) )
/* This is no longer actually implemented by throwing an exception, but it acts
* the same way to code in practice. */
void RageException::Throw(const char *fmt, ...)
void RageException::Throw( const char *sFmt, ... )
{
va_list va;
va_start(va, fmt);
RString error = vssprintf( fmt, va );
va_start( va, sFmt );
RString error = vssprintf( sFmt, va );
va_end(va);
RString msg = ssprintf(
"\n"
"//////////////////////////////////////////////////////\n"
"Exception: %s\n"
"//////////////////////////////////////////////////////\n"
"",
error.c_str());
if(LOG)
"\n"
"//////////////////////////////////////////////////////\n"
"Exception: %s\n"
"//////////////////////////////////////////////////////\n"
"",
error.c_str() );
if( LOG )
{
LOG->Trace("%s", msg.c_str());
LOG->Trace( "%s", msg.c_str() );
LOG->Flush();
}
else
{
printf("%s\n", msg.c_str());
fflush(stdout);
printf( "%s\n", msg.c_str() );
fflush( stdout );
}
#if defined(_WINDOWS) && defined(DEBUG)
#if defined(WINDOWS) && defined(DEBUG)
if( IsDebuggerPresent() )
DebugBreak();
#endif