exceptions4c 4.0
Exceptions for C
Loading...
Searching...
No Matches
e4c_exception Struct Reference

Represents a specific occurrence of an exceptional situation in a program. More...

#include <exceptions4c.h>

Data Fields

const struct e4c_exception_typetype
 The general nature of the error.
 
const char * name
 The name of the exception type.
 
char message [256]
 A text message describing the specific problem.
 
struct e4c_debug_info debug
 Debugging information about this exception.
 
int error_number
 The value of errno at the time this exception was thrown.
 
struct e4c_exceptioncause
 A possibly-null pointer to the current exception when this exception was thrown.
 
void * data
 A possibly-null pointer to custom data associated to this exception.
 

Detailed Description

Represents a specific occurrence of an exceptional situation in a program.

An exception combines a type with a detailed error message and specific information about what went wrong in this particular instance.

After an exception is thrown, it propagates through the program and MAY be caught by an appropriate CATCH or CATCH_ALL block.

Remarks
When an exception is caught, e4c_get_exception MAY be used to retrieve the exception currently being handled. This allows for inspection and further handling of the error, based on both its type and the detailed context of the situation.
See also
e4c_get_exception

Field Documentation

◆ type

const struct e4c_exception_type* type

The general nature of the error.

◆ name

const char* name

The name of the exception type.

◆ message

char message[256]

A text message describing the specific problem.

◆ debug

struct e4c_debug_info debug

Debugging information about this exception.

◆ error_number

int error_number

The value of errno at the time this exception was thrown.

◆ cause

struct e4c_exception* cause

A possibly-null pointer to the current exception when this exception was thrown.

◆ data

void* data

A possibly-null pointer to custom data associated to this exception.


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