Exceptions are now derived from std::exception and tell source code file and line.

This commit is contained in:
lotodore
2007-10-18 20:36:49 +00:00
parent 2ba5ce4b48
commit 4c56390dc7
20 changed files with 170 additions and 147 deletions
+19
View File
@@ -18,8 +18,27 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "pokerthexception.h"
#include <sstream>
using namespace std;
PokerTHException::PokerTHException(const char *sourcefile, int sourceline, int errorId, int osErrorCode)
: m_errorId(errorId), m_osErrorCode(osErrorCode)
{
ostringstream msgStream;
msgStream << sourcefile << " (" << sourceline << "): Error " << errorId;
if (osErrorCode)
msgStream << " (system error " << osErrorCode << ")";
m_msg = msgStream.str();
}
PokerTHException::~PokerTHException()
{
}
const char *
PokerTHException::what() const
{
return m_msg.c_str();
}