Sending errors on Android

Example with groupIdentifier

If errors are sent using methods with groupIdentifier, they're grouped by ID.

try {
    Integer.valueOf("00xffWr0ng");
} catch (Throwable error) {
    YandexMetrica.reportError("Your ID", "Error while parsing some integer number", error);
}
Copied to clipboard

Don't use variable values as grouping IDs. Otherwise, the number of groups increases and it becomes difficult to analyze them.

Example with message

If errors are sent using the YandexMetrica.reportError(String message, Throwable error) method, they're grouped by stack trace.

try {
    Integer.valueOf("00xffWr0ng");
} catch (Throwable error) {
    YandexMetrica.reportError("Error while parsing some integer number", error);
}
Copied to clipboard

If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.