Work on evaluation
This commit is contained in:
22
src/Evaluator/EvaluationException.hpp
Normal file
22
src/Evaluator/EvaluationException.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
#ifndef PORYGONLANG_EVALUATIONEXCEPTION_HPP
|
||||
#define PORYGONLANG_EVALUATIONEXCEPTION_HPP
|
||||
#include <exception>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class EvaluationException : std::exception {
|
||||
string _message;
|
||||
public:
|
||||
explicit EvaluationException(string message){
|
||||
_message = message;
|
||||
}
|
||||
|
||||
const string defaultErrorText = "An evaluation exception occurred: ";
|
||||
const char* what() const noexcept final{
|
||||
return (defaultErrorText + _message).c_str();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif //PORYGONLANG_EVALUATIONEXCEPTION_HPP
|
||||
Reference in New Issue
Block a user