28 #ifndef UR_CLIENT_LIBRARY_EXCEPTIONS_H_INCLUDED 29 #define UR_CLIENT_LIBRARY_EXCEPTIONS_H_INCLUDED 46 explicit UrException(
const std::string& what_arg) : std::runtime_error(what_arg)
49 explicit UrException(
const char* what_arg) : std::runtime_error(what_arg)
68 explicit VersionMismatch(
const std::string& text,
const uint32_t version_req,
const uint32_t version_actual)
69 : std::runtime_error(text)
71 version_required_ = version_req;
72 version_actual_ = version_actual;
74 ss << text <<
"(Required version: " << version_required_ <<
", actual version: " << version_actual_ <<
")";
79 virtual const char*
what() const noexcept
override 99 explicit ToolCommNotAvailable(
const std::string& text,
const uint32_t version_req,
const uint32_t version_actual)
100 : std::runtime_error(text),
VersionMismatch(text, version_req, version_actual)
112 explicit TimeoutException(
const std::string& text, timeval timeout) : std::runtime_error(text)
114 std::stringstream ss;
115 ss << text <<
"(Configured timeout: " << timeout.tv_sec + timeout.tv_usec * 1e-6 <<
" sec)";
118 virtual const char*
what() const noexcept
override 120 return text_.c_str();
127 #endif // ifndef UR_CLIENT_LIBRARY_EXCEPTIONS_H_INCLUDED virtual const char * what() const noexceptoverride
UrException(const char *what_arg)
TimeoutException(const std::string &text, timeval timeout)
uint32_t version_required_
A specialized exception representing detection of a not supported UR control version.
virtual const char * what() const noexceptoverride
virtual ~UrException()=default
UrException(const std::string &what_arg)
A specialized exception representing that communication to the tool is not possible.
VersionMismatch(const std::string &text, const uint32_t version_req, const uint32_t version_actual)
Our base class for exceptions. Specialized exceptions should inherit from those.