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
+2 -2
View File
@@ -58,7 +58,7 @@ SessionManager::AddSession(SessionWrapper session)
// already exists within the list.
if (pos != m_sessionMap.end() && session.sessionData->GetSocket() == pos->first)
{
throw ServerException(ERR_SOCK_CONN_EXISTS, 0);
throw ServerException(__FILE__, __LINE__, ERR_SOCK_CONN_EXISTS, 0);
}
m_sessionMap.insert(pos, SessionMap::value_type(session.sessionData->GetSocket(), session));
}
@@ -126,7 +126,7 @@ SessionManager::Select(unsigned timeoutMsec)
int selectResult = select(maxSock + 1, &rdset, NULL, NULL, &timeout);
if (!IS_VALID_SELECT(selectResult))
{
throw ServerException(ERR_SOCK_SELECT_FAILED, SOCKET_ERRNO());
throw ServerException(__FILE__, __LINE__, ERR_SOCK_SELECT_FAILED, SOCKET_ERRNO());
}
if (selectResult > 0) // one (or more) of the sockets is readable
{