[skip ci] Do not throw plain C string as exception

This commit is contained in:
wmayer
2021-02-06 15:52:21 +01:00
parent bad8257370
commit 0d5b38385c
4 changed files with 11 additions and 10 deletions

View File

@@ -122,17 +122,17 @@ MemDebug::MemDebug()
// Open a log file for the hook functions to use
if ( logFile != NULL )
throw "Base::MemDebug::MemDebug():38: Don't call the constructor by your self!";
throw std::runtime_error("Base::MemDebug::MemDebug():38: Don't call the constructor by your self!");
#if (_MSC_VER >= 1400)
fopen_s( &logFile, "MemLog.txt", "w" );
if ( logFile == NULL )
throw "Base::MemDebug::MemDebug():41: File IO Error. Can't open log file...";
throw std::runtime_error("Base::MemDebug::MemDebug():41: File IO Error. Can't open log file...");
_strtime_s( timeStr, 15 );
_strdate_s( dateStr, 15 );
#elif (_MSC_VER >= 1200)
logFile = fopen( "MemLog.txt", "w" );
if ( logFile == NULL )
throw "Base::MemDebug::MemDebug():41: File IO Error. Can't open log file...";
throw std::runtime_error("Base::MemDebug::MemDebug():41: File IO Error. Can't open log file...");
_strtime( timeStr );
_strdate( dateStr );
#endif