Improve runtime error handling

This commit is contained in:
2020-05-16 11:54:49 +02:00
parent 41fb08373c
commit 30252e5863
4 changed files with 77 additions and 10 deletions

View File

@@ -1,27 +1,44 @@
#pragma once
#include <string>
namespace Execute
{
struct RuntimeError
class RuntimeError
{
protected:
std::string message;
public:
std::string const & GetMessage() const;
RuntimeError();
RuntimeError(std::string const & what);
};
struct StackUnderflow : RuntimeError
class StackUnderflow : public RuntimeError
{
public:
StackUnderflow();
};
struct StackOverflow : RuntimeError
class StackOverflow : public RuntimeError
{
public:
StackOverflow();
};
class MissingLabel : public RuntimeError
{
public:
MissingLabel(std::string const & label);
};
namespace Internal
{
struct BadValueType : RuntimeError
class BadValueType : public RuntimeError
{
public:
BadValueType();
};
}
}