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.
To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint. Alternatively, you can double-click on this position. The Breakpoints view allows you to delete and deactivate Breakpoints and modify their properties.
You can fix this immediately by opening the Markers view and delete the Java Exception Breakpoints. However, to permanently remove this type of breakpoints, you have to go to the Java Debug options and uncheck the "Suspend excecution on uncaught exceptions" option.
Use F5 to trace into, F6 to step over, CTRL-SHIFT-B to set/remove breakpoints.
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 !
In the debug view, click on the thread producing the exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With