diff --git a/stepmania/src/RageException.cpp b/stepmania/src/RageException.cpp index 23a93af483..86143e877d 100644 --- a/stepmania/src/RageException.cpp +++ b/stepmania/src/RageException.cpp @@ -12,6 +12,7 @@ #include "RageException.h" #include "RageUtil.h" +#include "RageLog.h" RageException::RageException( const char *fmt, ...) { @@ -38,6 +39,12 @@ RageException::ThrowFatal(const char *fmt, ...) CString error = vssprintf( fmt, va ); va_end(va); + if(LOG) + { + LOG->Trace("Fatal exception thrown: %s", error.GetString()); + LOG->Flush(); + } + #if defined(WIN32) && defined(DEBUG) MessageBox( NULL, error, "Fatal Error", MB_OK ); DebugBreak(); @@ -51,5 +58,11 @@ RageException::ThrowNonfatal(const char *fmt, ...) va_list va; va_start(va, fmt); + if(LOG) + { + LOG->Trace("Nonfatal exception thrown: %s", vssprintf( fmt, va ).GetString()); + LOG->Flush(); + } + throw RageException(fmt, va); }