开发者

How do i catch unchecked exceptions in SWT's event-loop

i guess the question is pretty clear, i want to catch (and log) RuntimeException that occur i开发者_Go百科n SWT's event-loop. Right now i'm wrapping all my calls to code in a Runnable which logs any RuntimeException, but this has drawbacks like adding a lot of boilerplate-code and not being able to catch exceptions in third-party gui-libraries.


You can create an UncaughtExceptionHandler that will be called when an exception is thrown and not caught somewhere in the code. This allows you do to the last minute logging you want to achieve. Here is a more detailed article that shows how you can use the handler.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜