Java uncaught global exception handler for ALL threads

前端 未结 3 1476
挽巷
挽巷 2021-01-17 06:16

I asked a question about how to override the default Java Exception handling here and was told the answer here.

The question is now : is there a way to generify this

3条回答
  •  有刺的猬
    2021-01-17 06:58

    You can use Thread.setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh) for that case if i got it right.

    See Thread.setDefaultUncaughtExceptionHandler

提交回复
热议问题