Exception Tracking

Usage Intelligence is able to collect runtime exceptions from your application and then produce reports on the exceptions that were collected. Once an exception is tracked, Usage Intelligence will also save a snapshot of the current machine architecture so that you can later (through the on-line exception browser within the Usage Intelligence dashboard) investigate the exception details and pinpoint any specific OS or architecture related information that are the cause of common exceptions.

The ruiTrackException() function logs an exception event with the supplied data.

ruiTrackException() can be called between ruiStartSDK() and ruiStopSDK(), and can be called zero or more times.

ruiTrackException() can be called while a New Registration is being performed (ruiCreateConfig(), ruiStartSDK()). However, the event data is not written to the log file until the New Registration completes, and if the New Registration fails, the data will be lost.

ruiTrackException() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).


RUIRESULT ruiTrackException(RUIINSTANCE* ruiInstance, RUIEXCEPTIONEVENT exceptionData, const char* sessionID)


The ruiTrackException() function has the following parameters.

ruiTrackException() Parameters



ruiInstance (RUIINSTANCE*)

Pointer to the Usage Intelligence instance created via ruiCreateInstance().

event (RUIExecptionEvent)

A struct containing the exception event data to be logged.

The RUIExecptionEvent class contains the following fields:

const char* className;

const char* methodName;

const char* exceptionMessage;

const char* stackTrace;

The content of exceptionData.className and exceptionData.methodName are conditioned and validated (after conditioning) with the following rules:

Conditioning—All leading white space is removed.
Conditioning—All trailing white space is removed.
Conditioning—All internal white spaces other than space characters (‘ ‘) are removed.
Conditioning—Trimmed to a maximum of 128 UTF-8 characters.
Validation—Cannot be empty.

sessionID (const char*)

An optional session ID complying with above usage (content conditioning and validation rules in ruiStartSession()). Empty if not used.

Different than V4 of the Usage Intelligence (Trackerbird) SDK, ruiTrackException() accepts a sessionID parameter. The usage requirements of the sessionID parameter are the following:

If multiple user sessions are supported within the application (multiSessionEnabled = true), sessionID must be a current valid value used in ruiStartSession(), or it can be empty. This is different than normal event tracking APIs, whereby an empty value is not allowed.
If the application supports only a single session (multiSessionEnabled = false), then sessionID must be empty.


The ruiTrackException() function returns one of the return status constants below.

ruiTrackException() Returns




Synchronous functionality successful.


SDK Instance parameter is NULL or invalid.


Irrecoverable internal fatal error. No further API calls should be made.


A required New Registration has failed, and hence the SDK is aborted. ruiStopSDK() and ruiDestroyInstance() are possible.


The Server has instructed a temporary back-off.


The Server has instructed a permanent disable.


Instance has been instructed by the application to opt-out.


Configuration has not been successfully created.


SDK has not been successfully started.


SDK has already been successfully stopped.


The sessionID is expected to be empty, and it was not.


The sessionID violates its allowable minimum length.


The sessionID violates its allowable maximum length.


The sessionID is not currently in use.


Some API parameter is expected to be non-empty, and is not.