- 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:
parent
d4e630c127
commit
bced30d1e3
5 changed files with 25 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue