Motion Master
|
Exception thrown when a device responds with an error. More...
#include <base.h>
Public Member Functions | |
DeviceResponseException (const std::string &what_arg, uint16_t position, int code) | |
Constructs a DeviceResponseException. More... | |
uint16_t | position () const noexcept |
Returns the device position or ID. More... | |
int | code () const noexcept |
Returns the device-specific error code. More... | |
Exception thrown when a device responds with an error.
This exception extends std::runtime_error to include the device's position (or ID) and a device-specific error code for more detailed error handling and diagnostics.
mm::comm::base::DeviceResponseException::DeviceResponseException | ( | const std::string & | what_arg, |
uint16_t | position, | ||
int | code | ||
) |
Constructs a DeviceResponseException.
what_arg | Human-readable error message. |
position | Position or ID of the device related to the error. |
code | Device-specific error code. |
|
noexcept |
Returns the device-specific error code.
|
noexcept |
Returns the device position or ID.