Is there an unhandled exception handler in Java?

前端 未结 5 1903
温柔的废话
温柔的废话 2020-12-03 08:00

If i remember correctly in .NET one can register \"global\" handlers for unhandled exceptions. I am wondering if there is something similar for Java.

5条回答
  •  半阙折子戏
    2020-12-03 08:05

    Yes, there's the defaultUncaughtExceptionHandler, but it only triggers if the Thread doesn't have a uncaughtExceptionHandler set.

提交回复
热议问题