# tibemsErrorContext

Type

## Purpose

Enable additional error tracking

## Remarks

The `tibemsErrorContext` objects collect additional error information beyond the status returned by most EMS calls. When a `tibemsErrorContext` is created, EMS records detailed error information and a stack trace for the last error detected inside the EMS client library. Upon encountering an EMS error, the error information is written to the `tibemsErrorContext` object and then cleared at the start of the next public EMS function call.

Because each thread of execution in an application may contain specific error information, `tibemsErrorContext` objects should be created at the start of each thread and then destroyed before exiting the thread. Threads spawned internally by EMS will automatically create `tibemsErrorContext` objects.

Function | Description
--- | ---
`tibemsErrorContext_Create` | Create a new error context object.
`tibemsErrorContext_Close` | Close and free memory associated with an error context.
`tibemsErrorContext_GetLastErrorString` | Retrieve any available detailed error string associated with the last EMS call.
`tibemsErrorContext_GetLastErrorStackTrace` | Retrieve a stack trace associated with the last EMS call.

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