lxaGetSalienceErrorString

<< lxaDumpEnvironment | Back to Salience 6 C API Index | lxaGetLastWarnings >>

Summary

Gets a human readable string describing the last error that occurred. This function sets the passed in char* to point to a null terminated string containing the error message. After use you should free the allocated memory by calling lxaFreeString.

Syntax

int lxaGetSalienceErrorString(SalienceSession* pSession, char** ppErrorString);

Parameters

pSession Pointer to a SalienceSession structure previously returned by a call to lxaOpenSalienceSession
ppErrorString Pointer to a char* buffer

Returns

This method returns an integer return code.

Example

    SalienceSession* pSession;
    char* acError;
    ...
    if (lxaOpenSalienceSession(oLicense,acDataPath,&pSession,&acError) == LXA_OK)
    {
        try  //Set it up so we throw if an error code is returned from a Salience call
        {
        ...
        }
        catch(...)
        {
            lxaGetSalienceErrorString(pSession,&acError);
            lxaFreeString(acError);
        }
        // Use the session
        lxaCloseSalienceSession(pSession);
    }

<< lxaDumpEnvironment | Back to Salience 6 C API Index | lxaGetLastWarnings >>