Eclipse中的异常断点 - 如何检查异常对象? [英] Breakpoint at exception in Eclipse - how to examine Exception object?
问题描述
线程[Thread-1](已挂起(异常AssertionFailedException))
ContactManager .addContact(String)行:93
ContactManager $ ContactDataCallback.dispatch(String,Element,ClientConnector)行:118
PacketHandler.handle(FractusPacket)行:173
ServerConnection.syncProcess(FractusMessage)行:122
ServerConnection.run()行:248
Thread.run()行:636
但是,我正在寻找,如:
Getter被称为外观的可观察的org.eclipse.core.databinding.observable.set.WritableSet@4b7361e2,直到我通过异常(从而传播它一直到堆栈),它输出异常的类型,文本(这是我想要的部分)和堆栈跟踪。
我如何检查AssertationFailedException(或任何其他excel )以获取构造异常的消息?当然,我在Debug的视角。
在Eclipse首选项中有一个允许检查抛出的异常的选项:
检查 Java - >调试 - >在例外情况下暂停弹出窗口
使用此选项将弹出一个允许检查异常的弹出窗口。
奇怪的是,这个选项没有被默认选中,因为它非常有用!
I feel like I'm missing something very simple here. I have Eclipse set up to break on all exceptions. So, let's say that it breaks on an AssertationFailedException. The Debug window will show that thread suspended and has the following data:
Thread [Thread-1] (Suspended (exception AssertionFailedException)) ContactManager.addContact(String) line: 93 ContactManager$ContactDataCallback.dispatch(String, Element, ClientConnector) line: 118 PacketHandler.handle(FractusPacket) line: 173 ServerConnection.syncProcess(FractusMessage) line: 122 ServerConnection.run() line: 248 Thread.run() line: 636
However, the text that I'm looking for, such as: "Getter called outside realm of observable org.eclipse.core.databinding.observable.set.WritableSet@4b7361e2", is not available until I step through the exception (thus propagating it all the way up the stack) where it outputs the type of the exception, the text (which is the part that I want) and the stack trace.
How can I examine the "AssertationFailedException" (or any other exception) in order to get the message with which the exception was constructed? Of course I'm in the Debug perspective.
There is an option in the Eclipse Preferences that allows inspecting of the thrown exception:
Check Java -> Debug -> Open popup when suspended on exception
With this option there will be a popup allowing inspection of the exception.
Strange that this option is not checked by default as it is very useful !
这篇关于Eclipse中的异常断点 - 如何检查异常对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!