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-17 16:35:12 +00:00
|
|
|
namespace Porygon::Evaluation {
|
|
|
|
class EvaluationException : public std::exception {
|
|
|
|
string _message;
|
|
|
|
public:
|
2019-06-29 14:18:59 +00:00
|
|
|
explicit EvaluationException(const string& message) {
|
|
|
|
_message = defaultErrorText +message;
|
2019-06-17 16:35:12 +00:00
|
|
|
}
|
2019-05-23 16:50:09 +00:00
|
|
|
|
2019-06-17 16:35:12 +00:00
|
|
|
const string defaultErrorText = "An evaluation exception occurred: ";
|
2019-05-23 16:50:09 +00:00
|
|
|
|
2019-07-04 17:08:13 +00:00
|
|
|
inline const char *what() const noexcept final {
|
2019-06-29 14:18:59 +00:00
|
|
|
return _message.c_str();
|
2019-06-17 16:35:12 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2019-05-23 16:50:09 +00:00
|
|
|
|
|
|
|
#endif //PORYGONLANG_EVALUATIONEXCEPTION_HPP
|