added an new exception to handle cases where a wrong template is given to eoParser::valueOf
This commit is contained in:
parent
1bc2c5cc46
commit
8c121bdafb
3 changed files with 39 additions and 6 deletions
|
|
@ -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__
|
||||
|
|
|
|||
Reference in a new issue