+ use dedicated exception classes for expression and parsing errors
This commit is contained in:
@@ -321,6 +321,40 @@ DivisionByZeroError::DivisionByZeroError(const DivisionByZeroError &inst)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
ExpressionError::ExpressionError(const char * sMessage)
|
||||
: Exception(sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ExpressionError::ExpressionError(const std::string& sMessage)
|
||||
: Exception(sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ExpressionError::ExpressionError(const ExpressionError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
ParserError::ParserError(const char * sMessage)
|
||||
: Exception(sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ParserError::ParserError(const std::string& sMessage)
|
||||
: Exception(sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ParserError::ParserError(const ParserError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
#if defined(__GNUC__) && defined (FC_OS_LINUX)
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
|
||||
@@ -286,6 +286,39 @@ public:
|
||||
virtual ~DivisionByZeroError() throw() {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The ExpressionError can be used to indicate erroneous.input
|
||||
* to the expression engine.
|
||||
* @author Werner Mayer
|
||||
*/
|
||||
class BaseExport ExpressionError : public Exception
|
||||
{
|
||||
public:
|
||||
/// Construction
|
||||
ExpressionError(const char * sMessage);
|
||||
ExpressionError(const std::string& sMessage);
|
||||
/// Construction
|
||||
ExpressionError(const ExpressionError &inst);
|
||||
/// Destruction
|
||||
virtual ~ExpressionError() throw() {}
|
||||
};
|
||||
|
||||
/**
|
||||
* The ParserError can be used to indicate the parsing error.
|
||||
* @author Werner Mayer
|
||||
*/
|
||||
class BaseExport ParserError : public Exception
|
||||
{
|
||||
public:
|
||||
/// Construction
|
||||
ParserError(const char * sMessage);
|
||||
ParserError(const std::string& sMessage);
|
||||
/// Construction
|
||||
ParserError(const ParserError &inst);
|
||||
/// Destruction
|
||||
virtual ~ParserError() throw() {}
|
||||
};
|
||||
|
||||
|
||||
inline void Exception::setMessage(const char * sMessage)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user