This commit is contained in:
Glenn Maynard
2003-12-21 21:34:01 +00:00
parent 8a77374e04
commit 13d6ec2284
2 changed files with 8 additions and 15 deletions
+7 -13
View File
@@ -19,17 +19,9 @@
#include "windows.h" #include "windows.h"
#endif #endif
RageException::RageException( const char *fmt, ...) RageException::RageException( const CString &str ):
m_sError(str)
{ {
va_list va;
va_start(va, fmt);
m_sError = vssprintf( fmt, va );
va_end(va);
}
RageException::RageException( const char *fmt, va_list va)
{
m_sError = vssprintf( fmt, va );
} }
const char* RageException::what() const throw () const char* RageException::what() const throw ()
@@ -67,19 +59,21 @@ void RageException::Throw(const char *fmt, ...)
DebugBreak(); DebugBreak();
#endif #endif
throw RageException("%s", error.c_str()); throw RageException( error );
} }
void RageException::ThrowNonfatal(const char *fmt, ...) void RageException::ThrowNonfatal(const char *fmt, ...)
{ {
va_list va; va_list va;
va_start(va, fmt); va_start(va, fmt);
CString error = vssprintf( fmt, va );
va_end(va);
if(LOG) if(LOG)
{ {
LOG->Trace("Nonfatal exception thrown: %s", vssprintf( fmt, va ).c_str()); LOG->Trace("Nonfatal exception thrown: %s", error.c_str());
LOG->Flush(); LOG->Flush();
} }
throw RageException(fmt, va); throw RageException( error );
} }
+1 -2
View File
@@ -17,8 +17,7 @@
class RageException : public exception class RageException : public exception
{ {
public: public:
RageException( const char *fmt, ...); RageException( const CString &str );
RageException( const char *fmt, va_list va);
virtual const char *what() const throw(); virtual const char *what() const throw();
virtual ~RageException() throw() { } virtual ~RageException() throw() { }