# tibemsErrorContext_GetLastErrorString

## Purpose

Retrieve any available detailed error string associated with the last EMS call.

## C Declaration

    tibems_status tibemsErrorContext_GetLastErrorString(
        tibemsErrorContext errorContext,
        const char** string);

## COBOL Call

    CALL "tibemsErrorContext_GetLastErrorString"
       USING BY VALUE errorContext,
           BY REFERENCE string,
       RETURNING tibems-status
    END-CALL.

## Parameters

Parameter | Description
--- | ---
`errorContext` | The error context.
`string` | Location of the detailed error string.

## Remarks

Error string includes the day and time the error occurred.

Passing `NULL` for the `errorContext` parameter will default to the error context of the current thread. This is useful for retrieving information from within a listener or exception callback. This function returns a pointer, not a copy of the error string. If the last call was considered a non-error, an empty string is returned.

Returns `TIBEMS_OK, TIBEMS_INVALID_ARG` (string is null, or passing an object created in a different thread), `TIBEMS_NOT_INITIALIZED` (no error context for this thread)

## See Also

`tibemsErrorContext_GetLastErrorStackTrace`

Copyright © Cloud Software Group, Inc. All rights reserved.