Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log Non-fatal errors on Crashlytics

On iOS it's possible to use recordError(error) to log non-fatal errors on Crashlytics but apparently this feature is not available for Android.

The only alternative I found is to use logException(e). I manage errors on my app and I want to log when specifics errors codes are returned. So, on Crashlytics I'd like the non-fatal errors to be referenced by the errorCode. But using the logException(e) method, errors are referenced by the method where logException(e) has been called.

How can I do that?

like image 354
Eselfar Avatar asked Mar 29 '17 11:03

Eselfar


People also ask

How do I log errors in Crashlytics?

You can also use Crashlytics below features to provide more information. Logging Non-Fatal Events: try { myMethodThatThrows(); } catch (Exception e) { Crashlytics. logException(e); // handle your exception here! }

What is non-fatal event in Crashlytics?

In addition to automatically reporting your app's crashes, Crashlytics lets you record non-fatal exceptions and sends them to you the next time your app launches. Note: Crashlytics only stores the most recent eight exceptions in a given app session.

What are non-fatal crashes Firebase?

A non-fatal error is a failure in your application that didn't result in a crash for the user.

What is non-fatal logging in Crashlytics?

Non-Fatal logging is where we start using the advanced features of Crashlytics which helps in diagnosing and fixing issues beyond the crashes logged while the app was being used. When exceptions are logged manually in Firebase, they are logged as non-fatals.

How to log non-fatal errors on Crashlytics for Android?

On iOS it's possible to use recordError (error) to log non-fatal errors on Crashlytics but apparently this feature is not available for Android. The only alternative I found is to use logException (e).

What is Crashlytics and how do I use it?

In addition to automatically reporting your app’s crashes, Crashlytics lets you record non-fatal exceptions and sends them to you the next time your app launches. Note: Crashlytics only stores the most recent eight exceptions in a given app session.

How does Crashlytics handle non-fatal exceptions?

In addition to automatically reporting your app’s crashes, Crashlytics lets you record non-fatal exceptions and sends them to you the next time your app launches. Note: Crashlytics only stores the most recent eight exceptions in a given app session. If your app throws more than eight exceptions in a session, older exceptions are lost.


1 Answers

What I do in order to report a non-fatal issue is to log an exception using the following code (remember you can throw any subclass of Exception):

Crashlytics.logException(new Exception("My custom error message"));

like image 126
Nicolás Carrasco-Stevenson Avatar answered Oct 16 '22 14:10

Nicolás Carrasco-Stevenson