- made CDoomError inherit from std::exception so that the main catch block can also deal with exceptions thrown by the STL.

- Also do not ignore empty exception messages as irrelevant. The only irrelevant exception type is CNoRunExit.
This commit is contained in:
Christoph Oelckers 2018-11-23 10:18:14 +01:00
commit bced30d1e3
5 changed files with 25 additions and 14 deletions

View file

@ -37,10 +37,11 @@
#include <string.h>
#include <stdio.h>
#include <exception>
#define MAX_ERRORTEXT 1024
class CDoomError
class CDoomError : public std::exception
{
public:
CDoomError ()
@ -69,13 +70,22 @@ public:
else
return NULL;
}
char const *what() const override
{
return m_Message;
}
protected:
char m_Message[MAX_ERRORTEXT];
};
class CNoRunExit : public CDoomError
class CNoRunExit : public std::exception
{
public:
CNoRunExit() : std::exception("NoRunExit")
{
}
};
class CRecoverableError : public CDoomError