pacemaker  1.1.24-3850484742
Scalable High-Availability cluster resource manager
Macros | Enumerations | Functions
error.h File Reference

Function and executable result codes. More...

#include <crm_config.h>
#include <assert.h>
Include dependency graph for error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CRM_ASSERT(expr)
 
#define pcmk_ok   0
 
#define PCMK_ERROR_OFFSET   190 /* Replacements on non-linux systems, see include/portability.h */
 
#define PCMK_CUSTOM_OFFSET   200 /* Purely custom codes */
 
#define pcmk_err_generic   201
 
#define pcmk_err_no_quorum   202
 
#define pcmk_err_schema_validation   203
 
#define pcmk_err_transform_failed   204
 
#define pcmk_err_old_data   205
 
#define pcmk_err_diff_failed   206
 
#define pcmk_err_diff_resync   207
 
#define pcmk_err_cib_modified   208
 
#define pcmk_err_cib_backup   209
 
#define pcmk_err_cib_save   210
 
#define pcmk_err_schema_unchanged   211
 
#define pcmk_err_cib_corrupt   212
 
#define pcmk_err_multiple   213
 
#define pcmk_err_node_unknown   214
 
#define pcmk_err_already   215
 
#define pcmk_err_bad_nvpair   216
 
#define pcmk_err_unknown_format   217
 
#define pcmk_err_panic   255
 

Enumerations

enum  pcmk_rc_e {
  pcmk_rc_no_quorum = -1017, pcmk_rc_schema_validation = -1016, pcmk_rc_schema_unchanged = -1015, pcmk_rc_transform_failed = -1014,
  pcmk_rc_old_data = -1013, pcmk_rc_diff_failed = -1012, pcmk_rc_diff_resync = -1011, pcmk_rc_cib_modified = -1010,
  pcmk_rc_cib_backup = -1009, pcmk_rc_cib_save = -1008, pcmk_rc_cib_corrupt = -1007, pcmk_rc_multiple = -1006,
  pcmk_rc_node_unknown = -1005, pcmk_rc_already = -1004, pcmk_rc_bad_nvpair = -1003, pcmk_rc_unknown_format = -1002,
  pcmk_rc_error = -1001, pcmk_rc_ok = 0
}
 Return codes for Pacemaker API functions. More...
 

Functions

const char * pcmk_rc_name (int rc)
 Get a return code constant name as a string. More...
 
const char * pcmk_rc_str (int rc)
 Get a user-friendly description of a return code. More...
 
int pcmk_rc2legacy (int rc)
 
int pcmk_legacy2rc (int legacy_rc)
 
const char * pcmk_strerror (int rc)
 
const char * pcmk_errorname (int rc)
 
const char * bz2_strerror (int rc)
 

Detailed Description

Function and executable result codes.

Definition in file error.h.

Macro Definition Documentation

◆ CRM_ASSERT

#define CRM_ASSERT (   expr)
Value:
do { \
if(__unlikely((expr) == FALSE)) { \
crm_abort(__FILE__, __FUNCTION__, __LINE__, #expr, TRUE, FALSE); \
abort(); /* Redundant but it makes analyzers like coverity and clang happy */ \
} \
} while(0)
#define __unlikely(expr)
Definition: crm.h:41

Definition at line 20 of file error.h.

◆ PCMK_CUSTOM_OFFSET

#define PCMK_CUSTOM_OFFSET   200 /* Purely custom codes */

Definition at line 47 of file error.h.

◆ pcmk_err_already

#define pcmk_err_already   215

Definition at line 62 of file error.h.

◆ pcmk_err_bad_nvpair

#define pcmk_err_bad_nvpair   216

Definition at line 68 of file error.h.

◆ pcmk_err_cib_backup

#define pcmk_err_cib_backup   209

Definition at line 56 of file error.h.

◆ pcmk_err_cib_corrupt

#define pcmk_err_cib_corrupt   212

Definition at line 59 of file error.h.

◆ pcmk_err_cib_modified

#define pcmk_err_cib_modified   208

Definition at line 55 of file error.h.

◆ pcmk_err_cib_save

#define pcmk_err_cib_save   210

Definition at line 57 of file error.h.

◆ pcmk_err_diff_failed

#define pcmk_err_diff_failed   206

Definition at line 53 of file error.h.

◆ pcmk_err_diff_resync

#define pcmk_err_diff_resync   207

Definition at line 54 of file error.h.

◆ pcmk_err_generic

#define pcmk_err_generic   201

Definition at line 48 of file error.h.

◆ pcmk_err_multiple

#define pcmk_err_multiple   213

Definition at line 60 of file error.h.

◆ pcmk_err_no_quorum

#define pcmk_err_no_quorum   202

Definition at line 49 of file error.h.

◆ pcmk_err_node_unknown

#define pcmk_err_node_unknown   214

Definition at line 61 of file error.h.

◆ pcmk_err_old_data

#define pcmk_err_old_data   205

Definition at line 52 of file error.h.

◆ pcmk_err_panic

#define pcmk_err_panic   255

Definition at line 71 of file error.h.

◆ pcmk_err_schema_unchanged

#define pcmk_err_schema_unchanged   211

Definition at line 58 of file error.h.

◆ pcmk_err_schema_validation

#define pcmk_err_schema_validation   203

Definition at line 50 of file error.h.

◆ pcmk_err_transform_failed

#define pcmk_err_transform_failed   204

Definition at line 51 of file error.h.

◆ pcmk_err_unknown_format

#define pcmk_err_unknown_format   217

Definition at line 69 of file error.h.

◆ PCMK_ERROR_OFFSET

#define PCMK_ERROR_OFFSET   190 /* Replacements on non-linux systems, see include/portability.h */

Definition at line 46 of file error.h.

◆ pcmk_ok

#define pcmk_ok   0

Definition at line 45 of file error.h.

Enumeration Type Documentation

◆ pcmk_rc_e

enum pcmk_rc_e

Return codes for Pacemaker API functions.

Any Pacemaker API function documented as returning a "standard Pacemaker return code" will return pcmk_rc_ok (0) on success, and one of this enumeration's other (negative) values or a (positive) system error number otherwise. The custom codes are at -1001 and lower, so that the caller may use -1 through -1000 for their own custom values if desired. While generally referred to as "errors", nonzero values simply indicate a result, which might or might not be an error depending on the calling context.

Enumerator
pcmk_rc_no_quorum 
pcmk_rc_schema_validation 
pcmk_rc_schema_unchanged 
pcmk_rc_transform_failed 
pcmk_rc_old_data 
pcmk_rc_diff_failed 
pcmk_rc_diff_resync 
pcmk_rc_cib_modified 
pcmk_rc_cib_backup 
pcmk_rc_cib_save 
pcmk_rc_cib_corrupt 
pcmk_rc_multiple 
pcmk_rc_node_unknown 
pcmk_rc_already 
pcmk_rc_bad_nvpair 
pcmk_rc_unknown_format 
pcmk_rc_error 
pcmk_rc_ok 

Definition at line 85 of file error.h.

Function Documentation

◆ bz2_strerror()

const char* bz2_strerror ( int  rc)

Definition at line 1390 of file logging.c.

◆ pcmk_errorname()

const char* pcmk_errorname ( int  rc)

Definition at line 992 of file logging.c.

◆ pcmk_legacy2rc()

int pcmk_legacy2rc ( int  legacy_rc)

Definition at line 1363 of file logging.c.

◆ pcmk_rc2legacy()

int pcmk_rc2legacy ( int  rc)

Definition at line 1351 of file logging.c.

◆ pcmk_rc_name()

const char* pcmk_rc_name ( int  rc)

Get a return code constant name as a string.

Parameters
[in]rcInteger return code to convert
Returns
String of constant name corresponding to rc

Definition at line 1181 of file logging.c.

◆ pcmk_rc_str()

const char* pcmk_rc_str ( int  rc)

Get a user-friendly description of a return code.

Parameters
[in]rcInteger return code to convert
Returns
String description of rc

Definition at line 1335 of file logging.c.

◆ pcmk_strerror()

const char* pcmk_strerror ( int  rc)

Definition at line 1017 of file logging.c.