Caught Exceptions

In addition to automatically reporting your app’s crashes, Crashlytics for Android lets you log caught exceptions in your app’s catch blocks. Add a call to Crashlytics.logException(Exception) to your catch block:

try {
  myMethodThatThrows();
} catch (Exception e) {
  Crashlytics.logException(e);
  // handle your exception here!
}

All logged exceptions will appear as “non-fatal” issues in the Fabric dashboard. Your issue summary will contain all the state information you are use to getting from crashes along with breakdowns by Android version and hardware device.

Logged Exceptions are grouped by Exception type and message.

Warning

Developers should avoid using unique values, such as user ID, product ID, and timestamps, in the Exception message field. Using unique values in these fields will cause a high cardinality of issues to be created. In this case, Crashlytics will limit the reporting of logged errors in your app. Unique values should instead be added to Logs and Custom Keys.

Note

For any individual app session, only the most recent 8 logged exceptions are stored.

Crashlytics processes exceptions on a dedicated background thread, so the performance impact to your app is minimal. To reduce your users’ network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches.