15 #ifndef DD_ERROR_H_INCLUDED
16 #define DD_ERROR_H_INCLUDED
60 class Error :
public std::exception {
62 static std::string joinArgs(
const std::vector<std::string>& oo_operation_args);
71 Error(
const std::string& oo_type_operation,
const std::string& message)
72 : _message(oo_type_operation +
": " + message)
74 _problems.push_back({oo_type_operation, message});
84 Error(
const std::string& oo_type_operation,
85 const std::vector<std::string>& oo_operation_args,
86 const std::string& message)
87 : _message(oo_type_operation +
"(" + joinArgs(oo_operation_args) +
")" +
": " + message)
89 _problems.push_back({oo_type_operation +
"(" + joinArgs(oo_operation_args) +
")", message});
100 Error(
const std::string& oo_type_operation,
101 const std::vector<std::string>& oo_operation_args,
102 const std::string& message,
103 const std::vector<Problem>&
problems)
104 : _message(oo_type_operation +
"(" + joinArgs(oo_operation_args) +
")" +
": " + message),
121 char const*
what() const noexcept
override
123 return _message.c_str();
127 std::string _message;
128 std::vector<Problem> _problems;
Exception helper class to collect information while parsing, adding DD Objects or other failed operat...
const std::vector< Problem > & problems() const
get the problems
Error(const std::string &oo_type_operation, const std::string &message)
CTOR.
Error(const std::string &oo_type_operation, const std::vector< std::string > &oo_operation_args, const std::string &message)
CTOR with arguments.
Error(const std::string &oo_type_operation, const std::vector< std::string > &oo_operation_args, const std::string &message, const std::vector< Problem > &problems)
CTOR with arguments.
char const * what() const noexcept override
get the problem message
std::vector< std::string > transformProblemList(const std::vector< Problem > &problems)
transforms the Problem List to a simple vector of strings.
definition of the ddl namespace
Problem to report to find the corresponding item name in a simple way.
std::string problem_message
the validation problem in text
std::string item_name
the item name