Functions
Error Reporting

Functions

WOLFSSL_API void wc_ErrorString (int err, char *buff)
 This function stores the error string for a particular error code in the given buffer. More...
 
WOLFSSL_API const char * wc_GetErrorString (int error)
 This function returns the error string for a particular error code. More...
 

Detailed Description

Function Documentation

◆ wc_ErrorString()

WOLFSSL_API void wc_ErrorString ( int  err,
char *  buff 
)

This function stores the error string for a particular error code in the given buffer.

Returns
none No returns.
Parameters
errorerror code for which to get the string
bufferbuffer in which to store the error string. Buffer should be at least WOLFSSL_MAX_ERROR_SZ (80 bytes) long

Example

char errorMsg[WOLFSSL_MAX_ERROR_SZ];
int err = wc_some_function();
if( err != 0) { // error occurred
wc_ErrorString(err, errorMsg);
}
See also
wc_GetErrorString

◆ wc_GetErrorString()

WOLFSSL_API const char* wc_GetErrorString ( int  error)

This function returns the error string for a particular error code.

Returns
string Returns the error string for an error code as a string literal.
Parameters
errorerror code for which to get the string

Example

char * errorMsg;
int err = wc_some_function();
if( err != 0) { // error occurred
errorMsg = wc_GetErrorString(err);
}
See also
wc_ErrorString