upd: include exception info in return value
This commit is contained in:
@ -14,24 +14,30 @@
|
||||
class InterpretException : public std::exception {
|
||||
public:
|
||||
InterpretException() {}
|
||||
InterpretException(const char *message) : m_message(message) {}
|
||||
InterpretException(const char *__message, int __code)
|
||||
: message(__message), code(__code) {}
|
||||
|
||||
const char *what() const noexcept override { return m_message; }
|
||||
const char *what() const noexcept override { return message.c_str(); }
|
||||
const int GetCode() const noexcept { return code; }
|
||||
|
||||
~InterpretException() noexcept override {}
|
||||
|
||||
private:
|
||||
const char *m_message;
|
||||
std::string message;
|
||||
int code;
|
||||
};
|
||||
|
||||
class FatalError : public std::exception {
|
||||
public:
|
||||
FatalError(const char *message) : m_message(message) {}
|
||||
FatalError(const char *__message, int __code)
|
||||
: message(__message), code(__code) {}
|
||||
|
||||
const char *what() const noexcept override { return m_message; }
|
||||
const char *what() const noexcept override { return message.c_str(); }
|
||||
const int GetCode() const noexcept { return code; }
|
||||
|
||||
private:
|
||||
const char *m_message;
|
||||
std::string message;
|
||||
int code;
|
||||
};
|
||||
enum FlowControlStatusType { BREAK, CONTINUE, RETURN };
|
||||
struct FlowType {
|
||||
|
Reference in New Issue
Block a user