Improve runtime error handling
This commit is contained in:
@@ -2,5 +2,43 @@
|
||||
|
||||
namespace Execute
|
||||
{
|
||||
|
||||
std::string const & RuntimeError::GetMessage() const
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
RuntimeError::RuntimeError()
|
||||
: message("Undocumented runtime error")
|
||||
{
|
||||
}
|
||||
|
||||
RuntimeError::RuntimeError(std::string const & what)
|
||||
: message(what)
|
||||
{
|
||||
}
|
||||
|
||||
StackUnderflow::StackUnderflow()
|
||||
: RuntimeError("Stack underflow error")
|
||||
{
|
||||
}
|
||||
|
||||
StackOverflow::StackOverflow()
|
||||
: RuntimeError("Stack overflow error")
|
||||
{
|
||||
}
|
||||
|
||||
MissingLabel::MissingLabel(std::string const & label)
|
||||
{
|
||||
message = "Missing jump/function label \"";
|
||||
message += label;
|
||||
message += '"';
|
||||
}
|
||||
|
||||
namespace Internal
|
||||
{
|
||||
BadValueType::BadValueType()
|
||||
: RuntimeError("Internal error: bad value type")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user