Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 00f647a

Browse files
committed
Also capture DXL error code in case of a communication error.
1 parent 4fdcae5 commit 00f647a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/dynamixel++/CommunicationError.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ namespace dynamixelplusplus
3030
class CommunicationError : public std::runtime_error
3131
{
3232
public:
33-
CommunicationError(dynamixel::PacketHandler * packet_handler, int const dxl_err_code)
33+
CommunicationError(
34+
dynamixel::PacketHandler * packet_handler,
35+
int const dxl_err_code)
3436
: std::runtime_error{packet_handler->getTxRxResult(dxl_err_code)}
37+
, error_code(dxl_err_code)
3538
{ }
39+
40+
int const error_code;
3641
};
3742

3843
/**************************************************************************************

0 commit comments

Comments
 (0)