unilink  0.4.3
A simple C++ library for unified async communication
unilink::diagnostics::error_reporting Namespace Reference

Convenience functions for common error reporting scenarios. More...

Functions

void report_connection_error (std::string_view component, std::string_view operation, const boost::system::error_code &ec, bool retryable=true)
 Report connection-related error. More...
 
void report_communication_error (std::string_view component, std::string_view operation, std::string_view message, bool retryable=false)
 Report communication-related error. More...
 
void report_configuration_error (std::string_view component, std::string_view operation, std::string_view message)
 Report configuration error. More...
 
void report_memory_error (std::string_view component, std::string_view operation, std::string_view message)
 Report memory-related error. More...
 
void report_system_error (std::string_view component, std::string_view operation, std::string_view message, const boost::system::error_code &ec=boost::system::error_code{})
 Report system-level error. More...
 
void report_warning (std::string_view component, std::string_view operation, std::string_view message)
 Report warning (non-critical issue) More...
 
void report_info (std::string_view component, std::string_view operation, std::string_view message)
 Report informational message. More...
 

Detailed Description

Convenience functions for common error reporting scenarios.

Function Documentation

◆ report_communication_error()

UNILINK_API void unilink::diagnostics::error_reporting::report_communication_error ( std::string_view  component,
std::string_view  operation,
std::string_view  message,
bool  retryable = false 
)

Report communication-related error.

Parameters
componentComponent name
operationOperation that failed (e.g., "read", "write")
messageError message
retryableWhether this error is retryable

Definition at line 189 of file error_handler.cc.

◆ report_configuration_error()

UNILINK_API void unilink::diagnostics::error_reporting::report_configuration_error ( std::string_view  component,
std::string_view  operation,
std::string_view  message 
)

Report configuration error.

Parameters
componentComponent name
operationOperation that failed (e.g., "validate", "apply")
messageError message

Definition at line 196 of file error_handler.cc.

◆ report_connection_error()

UNILINK_API void unilink::diagnostics::error_reporting::report_connection_error ( std::string_view  component,
std::string_view  operation,
const boost::system::error_code &  ec,
bool  retryable = true 
)

Report connection-related error.

Parameters
componentComponent name (e.g., "serial", "tcp_server")
operationOperation that failed (e.g., "connect", "bind")
ecBoost error code
retryableWhether this error is retryable

Definition at line 183 of file error_handler.cc.

◆ report_info()

UNILINK_API void unilink::diagnostics::error_reporting::report_info ( std::string_view  component,
std::string_view  operation,
std::string_view  message 
)

Report informational message.

Parameters
componentComponent name
operationOperation
messageInformation message

Definition at line 217 of file error_handler.cc.

◆ report_memory_error()

UNILINK_API void unilink::diagnostics::error_reporting::report_memory_error ( std::string_view  component,
std::string_view  operation,
std::string_view  message 
)

Report memory-related error.

Parameters
componentComponent name
operationOperation that failed (e.g., "allocate", "deallocate")
messageError message

Definition at line 201 of file error_handler.cc.

◆ report_system_error()

UNILINK_API void unilink::diagnostics::error_reporting::report_system_error ( std::string_view  component,
std::string_view  operation,
std::string_view  message,
const boost::system::error_code &  ec = boost::system::error_code{} 
)

Report system-level error.

Parameters
componentComponent name
operationOperation that failed
messageError message
ecOptional Boost error code

Definition at line 206 of file error_handler.cc.

◆ report_warning()

UNILINK_API void unilink::diagnostics::error_reporting::report_warning ( std::string_view  component,
std::string_view  operation,
std::string_view  message 
)

Report warning (non-critical issue)

Parameters
componentComponent name
operationOperation
messageWarning message

Definition at line 212 of file error_handler.cc.