Interpreting Return Codes
lgo_ErrorMessage()
Retrieve a human-readable string describing an error.
#include "laygomsg.h"
LMessage lgo_ErrorMessage
(
LError error
);
| error | error code to retrieve error message for |
lgo_ErrorMessage() retrieves a human-readable string describing an error code returned by a LayGO API function.
All calls to lgo_ErrorMessage() are successful. If the error code is not defined, the message "LayGO error code not defined" is returned.
if ((bytes = lgo_Read(cid, buffer, size)) < 0)
{
msgString = lgo_ErrorMessage(bytes);
printf("lgo_Read() failure: '%s'\n", msgString);
}
else
{
/* process data */
}