exceptions4c-lite 1.0
Lightweight exception handling for C
Loading...
Searching...
No Matches
e4c_exception Struct Reference

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

#include <exceptions4c-lite.h>

Data Fields

e4c_exception_type type
 The general category of the error.
 
const char * name
 The name of the exception type.
 
char message [EXCEPTIONS4C_MAX_LENGTH]
 A text message describing the specific problem.
 
const char * file
 The name of the source file that threw this exception.
 
int line
 The line number in the source file that threw 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, 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
EXCEPTION

Field Documentation

◆ type

The general category of the error.

◆ name

const char* name

The name of the exception type.

◆ message

char message[EXCEPTIONS4C_MAX_LENGTH]

A text message describing the specific problem.

◆ file

const char* file

The name of the source file that threw this exception.

Precondition
This member is only available if NDEBUG is not defined.

◆ line

int line

The line number in the source file that threw this exception.

Precondition
This member is only available if NDEBUG is not defined.

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