We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f0577a commit 9880083Copy full SHA for 9880083
include/myactuator_rmd/protocol/single_motor_message.hpp
@@ -12,6 +12,8 @@
12
13
#include <array>
14
#include <cstdint>
15
+#include <ios>
16
+#include <sstream>
17
18
#include "myactuator_rmd/protocol/command_type.hpp"
19
#include "myactuator_rmd/protocol/message.hpp"
@@ -49,7 +51,9 @@ namespace myactuator_rmd {
49
51
constexpr SingleMotorMessage<C>::SingleMotorMessage(std::array<std::uint8_t,8> const& data)
50
52
: Message{data} {
53
if (data[0] != C) {
- throw ProtocolException("Unexpected response");
54
+ std::stringstream ss {};
55
+ ss << std::showbase << std::hex << static_cast<std::uint16_t>(data[0]);
56
+ throw ProtocolException("Unexpected response '" + ss.str() + "'");
57
}
58
return;
59
0 commit comments