Uncaught exception within uncaught exception handler

后端 未结 2 1593
我在风中等你
我在风中等你 2021-01-05 13:58

This question may sound a little silly ;)

How would approach the possibility of an uncaught exception within the UncaughtExceptionHandler?

2条回答
  •  渐次进展
    2021-01-05 14:14

    Well, you have to catch them yourself. The documentation of uncaughtException() linked by you states this clearly:

    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 who handles that code? It's the same with logging a failed logging event. Exception handlers all the way down...

提交回复
热议问题