libe3 0.2.5
C++ library for E3AP RAN vendor integration
Loading...
Searching...
No Matches
error_codes.h File Reference

libe3 error codes - shared C/C++ definitions More...

Go to the source code of this file.

Macros

#define LIBE3_ERROR_CODE_LIST
 X-macro list of all libe3 error codes.
#define X(name, val)

Typedefs

typedef int e3_error_t
 C error type alias.

Enumerations

enum  e3_error_code_e {
  E3_SUCCESS = 0 , E3_INVALID_PARAM = -1 , E3_NOT_INITIALIZED = -2 , E3_ALREADY_INITIALIZED = -3 ,
  E3_NOT_CONNECTED = -4 , E3_CONNECTION_FAILED = -5 , E3_TIMEOUT = -6 , E3_ENCODE_FAILED = -7 ,
  E3_DECODE_FAILED = -8 , E3_SM_NOT_FOUND = -9 , E3_SM_ALREADY_REGISTERED = -10 , E3_BUFFER_TOO_SMALL = -11 ,
  E3_INTERNAL_ERROR = -12 , E3_SUBSCRIPTION_EXISTS = -13 , E3_SUBSCRIPTION_NOT_FOUND = -14 , E3_DAPP_NOT_REGISTERED = -15 ,
  E3_TRANSPORT_ERROR = -16 , E3_STATE_ERROR = -17 , E3_SM_START_FAILED = -18 , E3_NOT_FOUND = -19 ,
  E3_SM_ERROR_INVALID_PARAM = -20 , E3_SM_ERROR_NOT_FOUND = -21 , E3_SM_ERROR_ALREADY_EXISTS = -22 , E3_SM_ERROR_THREAD_FAILED = -23 ,
  E3_SM_ERROR_MEMORY = -24 , E3_CANCELLED = -25 , E3_GENERIC_ERROR = -100
}
 C-compatible error code enumeration. More...

Functions

const char * e3_error_to_string (e3_error_t code)
 Convert a numeric error code to a human-readable name.

Detailed Description

libe3 error codes - shared C/C++ definitions

Provides a single source of truth for all libe3 error codes via an X-macro list. Both the C API (e3_error_code_e) and the C++ API (libe3::ErrorCode) are generated from this list.

SPDX-FileCopyrightText: Copyright (c) 2026 Northeastern University SPDX-License-Identifier: Apache-2.0

Definition in file error_codes.h.

Macro Definition Documentation

◆ X

#define X ( name,
val )
Value:
E3_##name = val,

Definition at line 105 of file error_codes.h.

Typedef Documentation

◆ e3_error_t

typedef int e3_error_t

C error type alias.

An int whose value is one of the e3_error_code_e constants. Zero means success; all error values are negative.

Definition at line 116 of file error_codes.h.

Enumeration Type Documentation

◆ e3_error_code_e

C-compatible error code enumeration.

Values match those in libe3::ErrorCode. Use the E3_ prefix to avoid collisions with C++ symbols.

Enumerator
E3_SUCCESS 
E3_INVALID_PARAM 
E3_NOT_INITIALIZED 
E3_ALREADY_INITIALIZED 
E3_NOT_CONNECTED 
E3_CONNECTION_FAILED 
E3_TIMEOUT 
E3_ENCODE_FAILED 
E3_DECODE_FAILED 
E3_SM_NOT_FOUND 
E3_SM_ALREADY_REGISTERED 
E3_BUFFER_TOO_SMALL 
E3_INTERNAL_ERROR 
E3_SUBSCRIPTION_EXISTS 
E3_SUBSCRIPTION_NOT_FOUND 
E3_DAPP_NOT_REGISTERED 
E3_TRANSPORT_ERROR 
E3_STATE_ERROR 
E3_SM_START_FAILED 
E3_NOT_FOUND 
E3_SM_ERROR_INVALID_PARAM 
E3_SM_ERROR_NOT_FOUND 
E3_SM_ERROR_ALREADY_EXISTS 
E3_SM_ERROR_THREAD_FAILED 
E3_SM_ERROR_MEMORY 
E3_CANCELLED 
E3_GENERIC_ERROR 

Definition at line 104 of file error_codes.h.

Function Documentation

◆ e3_error_to_string()

const char * e3_error_to_string ( e3_error_t code)

Convert a numeric error code to a human-readable name.

Parameters
codeError code value (one of e3_error_code_e)
Returns
Null-terminated string with the symbolic name, or "UNKNOWN_ERROR" if the value is not recognised.

Definition at line 428 of file c_api.cpp.