Uncaught exception within uncaught exception handler

若如初见. 提交于 2019-11-30 04:49:43

问题


This question may sound a little silly ;)

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


回答1:


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...




回答2:


Very interesting question, I haven't thought about this before.

The approch seems to be that either set your own uncaughtExceptionHandler on your thread or it will get passed to JAVAs defaultUncaughtExceptionHandler,

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



来源:https://stackoverflow.com/questions/7240872/uncaught-exception-within-uncaught-exception-handler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!