Motion Master
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mm::comm::base::DeviceResponseException Class Reference

Exception thrown when a device responds with an error. More...

#include <base.h>

Inheritance diagram for mm::comm::base::DeviceResponseException:
Inheritance graph
[legend]
Collaboration diagram for mm::comm::base::DeviceResponseException:
Collaboration graph
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DeviceResponseException()

mm::comm::base::DeviceResponseException::DeviceResponseException ( const std::string &  what_arg,
uint16_t  position,
int  code 
)

Constructs a DeviceResponseException.

Parameters
what_argHuman-readable error message.
positionPosition or ID of the device related to the error.
codeDevice-specific error code.

Member Function Documentation

◆ code()

int mm::comm::base::DeviceResponseException::code ( ) const
noexcept

Returns the device-specific error code.

◆ position()

uint16_t mm::comm::base::DeviceResponseException::position ( ) const
noexcept

Returns the device position or ID.


The documentation for this class was generated from the following files: