23 lines
538 B
C++
23 lines
538 B
C++
|
|
||
|
#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
|