![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Represents an error response message from the server. More...
#include <error.hpp>
Public Member Functions | |
std::string | toString () const |
Converts the error to a human-readable string. | |
Static Public Member Functions | |
template<typename T , std::enable_if_t< irsol::traits::is_type_in_variant_v< T, InMessage >, int > = 0> | |
static Error | from (const T &msg, const std::string &description) |
Creates an error from a specific incoming message type. | |
static Error | from (const InMessage &message, const std::string &description) |
Creates an error from a generic InMessage variant. | |
Public Attributes | |
std::string | identifier |
The identifier related to the failed operation (e.g., the variable or command name). | |
InMessageKind | source |
The kind of input message that triggered the error. | |
std::string | description |
A descriptive message explaining the cause of the error. | |
Private Member Functions | |
Error (const std::string &identifier, InMessageKind source, const std::string &description) | |
Represents an error response message from the server.
An Error
message is generated when a protocol input message fails to be parsed, interpreted, or executed correctly. It includes a reference identifier (if available), the type of message that caused the error, and a human-readable description of the issue.
Can be stored in a irsol::protocol::OutMessage variant.
|
private |
Definition at line 10 of file error.cpp.
|
static |
|
inlinestatic |
Creates an error from a specific incoming message type.
This templated overload supports Assignment, Command, and Inquiry input types.
T | The incoming message type. |
msg | The message that caused the error. |
description | The explanation of the error. |
Definition at line 63 of file error.hpp.
std::string irsol::protocol::Error::toString | ( | ) | const |
Converts the error to a human-readable string.
Definition at line 15 of file error.cpp.
std::string irsol::protocol::Error::description |
std::string irsol::protocol::Error::identifier |
InMessageKind irsol::protocol::Error::source |