2019-05-23 16:50:09 +00:00
|
|
|
|
2019-06-13 13:16:41 +00:00
|
|
|
|
2019-05-23 16:50:09 +00:00
|
|
|
#ifndef PORYGONLANG_EVALUATIONEXCEPTION_HPP
|
|
|
|
#define PORYGONLANG_EVALUATIONEXCEPTION_HPP
|
2019-06-13 13:16:41 +00:00
|
|
|
#include <utility>
|
2019-05-23 16:50:09 +00:00
|
|
|
#include <exception>
|
|
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
|
|
|
2019-06-13 13:16:41 +00:00
|
|
|
class EvaluationException : public std::exception {
|
2019-05-23 16:50:09 +00:00
|
|
|
string _message;
|
|
|
|
public:
|
|
|
|
explicit EvaluationException(string message){
|
2019-06-13 13:16:41 +00:00
|
|
|
_message = std::move(message);
|
2019-05-23 16:50:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const string defaultErrorText = "An evaluation exception occurred: ";
|
|
|
|
const char* what() const noexcept final{
|
|
|
|
return (defaultErrorText + _message).c_str();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //PORYGONLANG_EVALUATIONEXCEPTION_HPP
|