My Project
Functions
Error Reporting

Functions

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

Detailed Description

Function Documentation

◆ wc_ErrorString()

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);
}
void wc_ErrorString(int err, char *buff)
This function stores the error string for a particular error code in the given buffer.
See also
wc_GetErrorString

◆ wc_GetErrorString()

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);
}
const char * wc_GetErrorString(int error)
This function returns the error string for a particular error code.
See also
wc_ErrorString