2014-11-25 01:46:39 +03:00
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
class RecursionException: public std::exception {
|
|
|
|
public:
|
2014-11-25 02:25:38 +03:00
|
|
|
RecursionException(const char *recursiontype, const std::string &name)
|
|
|
|
: rectype(recursiontype), name(name) {}
|
|
|
|
virtual ~RecursionException() throw() {}
|
2014-11-25 01:46:39 +03:00
|
|
|
virtual const char *what() const throw() {
|
|
|
|
std::stringstream out;
|
2014-11-25 02:25:38 +03:00
|
|
|
out << "ERROR: Recursion detected calling " << this->rectype << " '" << this->name << "'";
|
2014-11-25 01:46:39 +03:00
|
|
|
return out.str().c_str();
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
const char *rectype;
|
2014-11-25 02:25:38 +03:00
|
|
|
const std::string name;
|
2014-11-25 01:46:39 +03:00
|
|
|
};
|