track().exception

The track().exception() method records caught exceptions (errors) in your app. For each exception, you need to define handling code.

Syntax

TrackHelper.track() .exception(ex) .description("description") .with(getTracker());
TrackHelper.track() .exception(ex) .description("description") .with(tracker)

Parameters

ex (Throwable, optional)

The caught exception instance. The exception instance is automatically translated into a URL and the following information is added to it: package name, activity path, method name and line number where the crash occurred.

description (string, optional)

Additional information about the issue.

Examples

To send a caught exception:

TrackHelper.track() .exception(new Exception("OnPurposeException")) .description("Download error") .with(getTracker());
TrackHelper.track() .exception(Exception("OnPurposeException")) .description("Download error") .with(tracker)

Did this page help you?