Robust Distributed System Nucleus (rDSN)  ver 1.0.0
Classes | Macros | Functions

Overview

See error_code for more details.

Classes

class  dsn::error_code
 

Macros

#define DEFINE_ERR_CODE(x)   __selectany const dsn::error_code x(#x);
 

Functions

DSN_API dsn_error_t dsn_error_register (const char *name)
 
DSN_API const char * dsn_error_to_string (dsn_error_t err)
 
DSN_API dsn_error_t dsn_error_from_string (const char *s, dsn_error_t default_err)
 

Function Documentation

DSN_API dsn_error_t dsn_error_register ( const char *  name)

register error code

Parameters
nameerror code in string format
Returns
interger value representing this error.

For the same input string, rDSN returns the same interger error code.

DSN_API const char* dsn_error_to_string ( dsn_error_t  err)

translate interger error code to a string

Parameters
errinteger error code
Returns
string format of the error code
DSN_API dsn_error_t dsn_error_from_string ( const char *  s,
dsn_error_t  default_err 
)

parse string error code into integer code

Parameters
sthe input error in string format
default_errto-be-returned error code if the string is not registered.
Returns
integer format of error code