Exception exception in the uncaught exception handler

This question may seem a little silly;)

How to approach the possibility of an uncaught exception in UncaughtExceptionHandler ?

+6
source share
3 answers

Well, you have to catch them. The uncaughtException() documentation you linked states:

Any exception thrown by this method will be ignored by the Java virtual machine.

But you can only plan so far. So you handle the exceptions of your exception handler, but which handles this code? The same thing happens with logging a failed registration event. Exception handlers completely omitted ...

+4
source

A very interesting question, I did not think about this before.

It is assumed that either set your own uncaughtExceptionHandler to your stream, or it will be passed to JAVAs defaultUncaughtExceptionHandler ,

I did some quick googeling and found a similar case for getting crash data from android. I think you may be interested in this link. How do I get crash data from my Android application?

+5
source

You can handle uncaught exceptions using the FireCrasher library , recover from it, and send user feedback as a dialog or message.

You can learn more about the library in this middle article.

0
source

Source: https://habr.com/ru/post/896191/


All Articles