ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
asciichat_error_context_t Struct Reference

Error context structure. More...

#include <include/ascii-chat/asciichat_errno.h>

Data Fields

asciichat_error_t code
 Error code (asciichat_error_t enum value)
 
const char * file
 Source file where error occurred (NULL in release builds)
 
int line
 Line number where error occurred (0 in release builds)
 
const char * function
 Function name where error occurred (NULL in release builds)
 
char * context_message
 Optional custom message (dynamically allocated, owned by system)
 
uint64_t timestamp
 Timestamp when error occurred (microseconds since epoch)
 
int system_errno
 System errno value (if applicable, 0 otherwise)
 
int wsa_error
 Windows socket error code (if applicable, 0 otherwise)
 
backtrace_t backtrace
 Stack trace (debug builds only)
 
bool has_system_error
 True if system_errno is valid.
 
bool has_wsa_error
 True if wsa_error is valid.
 

Detailed Description

Error context structure.

Contains full error context information including error code, location, stack trace (debug builds), and optional context message. This structure is stored in thread-local storage for thread-safe error handling.

Note
Stack traces are only captured in debug builds (DEBUG or ENABLE_ERRNO_BACKTRACES).
Context message is dynamically allocated and must be freed by the system.
Thread-local storage ensures each thread has independent error state.

Definition at line 241 of file asciichat_errno.h.

Field Documentation

◆ backtrace

backtrace_t asciichat_error_context_t::backtrace

Stack trace (debug builds only)

Definition at line 250 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), asciichat_errno_destroy(), asciichat_print_error_context(), and asciichat_set_errno().

◆ code

◆ context_message

char* asciichat_error_context_t::context_message

◆ file

const char* asciichat_error_context_t::file

Source file where error occurred (NULL in release builds)

Definition at line 243 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ function

const char* asciichat_error_context_t::function

Function name where error occurred (NULL in release builds)

Definition at line 245 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ has_system_error

◆ has_wsa_error

bool asciichat_error_context_t::has_wsa_error

True if wsa_error is valid.

Definition at line 252 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), asciichat_has_wsa_error(), and asciichat_set_errno_with_wsa_error().

◆ line

int asciichat_error_context_t::line

Line number where error occurred (0 in release builds)

Definition at line 244 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ system_errno

int asciichat_error_context_t::system_errno

◆ timestamp

uint64_t asciichat_error_context_t::timestamp

Timestamp when error occurred (microseconds since epoch)

Definition at line 247 of file asciichat_errno.h.

Referenced by asciichat_print_error_context(), and asciichat_set_errno().

◆ wsa_error

int asciichat_error_context_t::wsa_error

Windows socket error code (if applicable, 0 otherwise)

Definition at line 249 of file asciichat_errno.h.

Referenced by asciichat_clear_errno(), and asciichat_set_errno_with_wsa_error().


The documentation for this struct was generated from the following file: