Error Messages

Some functions return a SUCCESSFUL_RETURN or 0 (zero) value if they are successful. If it is not successful, the function returns an error code. In order to retrieve error messages, call getErrorMessage(int errorCode). For example:

Server *server = NULL; 
int nRet; 
//Create Server 
server = createServer(); 
//set the property to the server 
...	
//Connect to server 
printf("Making connection to the server...\n"); 
nRet = serverConnect(server); 
if(nRet != SUCCESSFUL_RETURN) 
{ 
// ASCII Version-use the following code 
printf(getErrorMessage(nRet)); 
//Unicode Version -use the following code 
UChar * error = getErrorMessage(nRet)); 
// more code to print out the error messageÂ….	
 return ; 
 }

The C API uses the following error messages.

  • Error messages for passing a null structure:
    • "Input null DataRow"
    • "Input null DataTable"
    • "Input null Message"
    • "Input null Server"
  • Error messages for connections:
    • "Connection type not supported"
    • "Client timeout"
    • "Blank connection property name"
    • "Blank property name"
  • Error messages for creating DataTable:
    • "Blank column name"
    • "Duplicated column name"
  • Error messages for MessagePackaging Exception:
    • "Input Message is null"
    • "Failed to connect to Server"
    • "Failed to disconnect from Server"
    • "Failed to open Http Connection"
    • "Failed to get Service"
    • "Failed to package the message using Serializer and Encoding"