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

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

1 char errorMsg[WOLFSSL_MAX_ERROR_SZ];
2 int err = wc_some_function();
3 
4 if( err != 0) { // error occurred
5  wc_ErrorString(err, errorMsg);
6 }
See also
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

1 char * errorMsg;
2 int err = wc_some_function();
3 
4 if( err != 0) { // error occurred
5  errorMsg = wc_GetErrorString(err);
6 }
See also
wc_ErrorString