29 #ifndef UR_CLIENT_LIBRARY_EXCEPTIONS_H_INCLUDED 30 #define UR_CLIENT_LIBRARY_EXCEPTIONS_H_INCLUDED 47 explicit UrException(
const std::string& what_arg) : std::runtime_error(what_arg)
50 explicit UrException(
const char* what_arg) : std::runtime_error(what_arg)
69 explicit VersionMismatch(
const std::string& text,
const uint32_t version_req,
const uint32_t version_actual)
70 : std::runtime_error(text)
72 version_required_ = version_req;
73 version_actual_ = version_actual;
75 ss << text <<
"(Required version: " << version_required_ <<
", actual version: " << version_actual_ <<
")";
80 virtual const char*
what() const noexcept
override 100 explicit ToolCommNotAvailable(
const std::string& text,
const uint32_t version_req,
const uint32_t version_actual)
101 : std::runtime_error(text),
VersionMismatch(text, version_req, version_actual)
113 explicit TimeoutException(
const std::string& text, timeval timeout) : std::runtime_error(text)
115 std::stringstream ss;
116 ss << text <<
"(Configured timeout: " << timeout.tv_sec + timeout.tv_usec * 1e-6 <<
" sec)";
119 virtual const char*
what() const noexcept
override 121 return text_.c_str();
128 #endif // ifndef UR_CLIENT_LIBRARY_EXCEPTIONS_H_INCLUDED virtual const char * what() const noexcept override
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 ~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)
virtual const char * what() const noexcept override
Our base class for exceptions. Specialized exceptions should inherit from those.