added an new exception to handle cases where a wrong template is given to eoParser::valueOf

This commit is contained in:
nojhan 2012-03-31 17:48:55 +02:00
commit 8c121bdafb
3 changed files with 39 additions and 6 deletions

View file

@ -103,4 +103,30 @@ public:
private:
std::string _name;
};
/*!
* An error that signals a bad parameter type
*
* Thrown by eoParser::valueOf
*
* @ingroup Parameters
*/
class eoWrongParamTypeException : public std::exception
{
public:
eoWrongParamTypeException(std::string name) : _name(name){}
virtual const char* what() const throw()
{
std::ostringstream ss;
ss << "You asked for the parameter " << _name << " but it has not been declared under this type";
return ss.str().c_str();
}
~eoWrongParamTypeException() throw() {}
private:
std::string _name;
};
#endif // __eoExceptions_h__