mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 07:25:18 +00:00
[4088] Exceptions added.
This commit is contained in:
@@ -61,11 +61,11 @@ EvalContext::parseString(const std::string& str)
|
|||||||
void
|
void
|
||||||
EvalContext::error(const isc::eval::location& l, const std::string& m)
|
EvalContext::error(const isc::eval::location& l, const std::string& m)
|
||||||
{
|
{
|
||||||
std::cerr << l << ": " << m << std::endl;
|
isc_throw(EvalError, l << ": " << m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EvalContext::error (const std::string& m)
|
EvalContext::error (const std::string& m)
|
||||||
{
|
{
|
||||||
std::cerr << m << std::endl;
|
isc_throw(EvalError, m);
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <eval/parser.h>
|
#include <eval/parser.h>
|
||||||
|
#include <exceptions/exceptions.h>
|
||||||
|
|
||||||
// Tell Flex the lexer's prototype ...
|
// Tell Flex the lexer's prototype ...
|
||||||
#define YY_DECL isc::eval::EvalParser::symbol_type yylex (EvalContext& driver)
|
#define YY_DECL isc::eval::EvalParser::symbol_type yylex (EvalContext& driver)
|
||||||
@@ -24,6 +25,14 @@
|
|||||||
// ... and declare it for the parser's sake.
|
// ... and declare it for the parser's sake.
|
||||||
YY_DECL;
|
YY_DECL;
|
||||||
|
|
||||||
|
/// @brief Evaluation error exception raised when trying to parse an axceptions.
|
||||||
|
class EvalError : public isc::exceptions::Exception {
|
||||||
|
public:
|
||||||
|
EvalError(const char* file, size_t line, const char* what) :
|
||||||
|
isc::Exception(file, line, what) { };
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/// @brief Evaluation context, an interface to the expression evaluation.
|
/// @brief Evaluation context, an interface to the expression evaluation.
|
||||||
class EvalContext
|
class EvalContext
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user