24 #ifndef ICL_HARDWARE_CANOPEN_EXCEPTIONS_H_INCLUDED 25 #define ICL_HARDWARE_CANOPEN_EXCEPTIONS_H_INCLUDED 32 namespace canopen_schunk{
42 const std::string& error_msg =
"none")
50 virtual const char*
what() const _GLIBCXX_USE_NOEXCEPT
53 ss <<
"A protocol error occurred at index " <<
hexToString(
index_) <<
", subindex " <<
55 return ss.str().c_str();
73 const std::string& error_msg =
"none")
79 virtual const char*
what() const _GLIBCXX_USE_NOEXCEPT
82 ss <<
"An invalid response was received for request at index " <<
hexToString(
index_) <<
84 return ss.str().c_str();
96 const std::string& error_msg =
"none")
102 virtual const char*
what() const _GLIBCXX_USE_NOEXCEPT
104 std::stringstream ss;
107 return ss.str().c_str();
118 : m_error_msg (error_msg)
123 virtual const char*
what() const _GLIBCXX_USE_NOEXCEPT
125 return m_error_msg.c_str();
139 : m_error_string(error_string)
144 virtual const char*
what() const _GLIBCXX_USE_NOEXCEPT
146 std::stringstream ss;
147 ss << m_error_string <<
" Check your configuration and make sure the device " <<
148 "is properly connected.";
149 return ss.str().c_str();
163 : m_error_string(error_string)
168 virtual const char*
what() const _GLIBCXX_USE_NOEXCEPT
170 return m_error_string.c_str();
virtual ~ResponseException(void) _GLIBCXX_USE_NOEXCEPT
virtual ~ProtocolException(void) _GLIBCXX_USE_NOEXCEPT
ResponseException(const uint16_t index, const uint8_t subindex, const std::string &error_msg="none")
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
TimeoutException(const uint16_t index, const uint8_t subindex, const std::string &error_msg="none")
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
Basic CanOpen exception that contains the Object dictionary index and subindex.
virtual ~NotFoundException(void) _GLIBCXX_USE_NOEXCEPT
std::string m_error_string
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
If a device response times out, this exception will be thrown.
PDO related exceptions go here.
This exception is thrown if a requested node or node group does not exist.
Exceptions relating to device responses.
virtual ~PDOException(void) _GLIBCXX_USE_NOEXCEPT
virtual ~DeviceException(void) _GLIBCXX_USE_NOEXCEPT
DeviceException(const std::string &error_string)
If something goes wrong with the host's CAN controller, this exception will be used.
NotFoundException(const std::string &error_string)
ProtocolException(const uint16_t index, const uint8_t subindex, const std::string &error_msg="none")
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
PDOException(const std::string &error_msg="none")
virtual ~TimeoutException(void) _GLIBCXX_USE_NOEXCEPT
virtual const char * what() const _GLIBCXX_USE_NOEXCEPT
std::string hexToString(const uint64_t num)
Converts a hexadecimal number into its string representation 0xXX.
std::string m_error_string