simplify
This commit is contained in:
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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() { }
|
||||||
|
|||||||
Reference in New Issue
Block a user