32 #include "dictionary_error.h"
42 case type::unknown_entry:
43 m_message =
"Dictionary entry \""+entry_name+
"\" not available.";
46 m_message =
"Attempt to write the read-only dictionary entry \""+entry_name+
"\".";
48 case type::write_only:
49 m_message =
"Attempt to read the write-only dictionary entry \""+entry_name+
"\".";
51 case type::wrong_type:
52 m_message =
"Data type does not match to the dictionary entry \""+entry_name+
"\".";
54 case type::mapping_size:
55 m_message =
"Invalid mapping size.";
57 case type::mapping_overlap:
58 m_message =
"Mappings overlap for this PDO.";
60 case type::unknown_operation:
61 m_message =
"Operation \""+entry_name+
"\" not available.";
63 case type::unknown_constant:
64 m_message =
"Constant \""+entry_name+
"\" not available.";
72 m_entry_name = entry_name;
73 m_message =
"Dictionary error: " + m_message + (additional_information.empty()?
"":
" "+additional_information);
78 return m_message.c_str();
dictionary_error(type error_type, const std::string &entry_name, const std::string &additional_information="")
Constructor.
This is the base class of all types of exceptions thrown by the KaCanOpen library. It can be used directly like std::runtime_error if there isn't any more specific error class.
std::string get_entry_name() const noexcept
Returns the name of the dictionary entry.
type
Exact type of the error.
virtual const char * what() const noexceptoverride
Returns error description.
type get_type() const noexcept
Returns type of the error.