1

I am trying to implement a crash log reporting library in Android like Crashlytics, ACRA. At the preliminary phase, I was able to get Uncaught Exception log using Thread.UncaughtExceptionHandler which is working fine.

For handling Caught Exceptions, One of the above mentioned two libraries use a single line at every catch block which can be painful for a large project. Is there any way to get the log of caught exception like the uncaught one in a single place?

P.S. I also used both libraries and they are really good crash reporting mechanisms. My point was not to criticize those rather finding a better way if possible. Thanks.

1 Answers1

1

When an exception occurs, it searches for a handler. If it finds one, the exception is handled and the normal control flow of the code coutinues.

So there are no clues that an exception has been caught except if specified in the corresponding catch block that actually got the exception.

Without additional logic in those catch blocks I`m afraid you could not know if an exception has ever been handled.

Krasimir Stoev
  • 1,734
  • 11
  • 9