Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inspect current exception in Eclipse debugger?

If a Java application throws an unhandled exception, it causes Eclipse to break at that point. Is there a way to inspect the current exception? Basically, $exception from MSVS?

like image 926
kizzx2 Avatar asked Jan 13 '12 16:01

kizzx2


1 Answers

In think the problem described occurs when making use of Exception breakpoint, in which case you don't have access to the exception variable and can't inspect it in the variables view.

I found a "solution" to this problem in the following post: Breakpoint at exception in Eclipse - how to examine Exception object?

It is:

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 !

like image 131
kwakeroni Avatar answered Oct 24 '22 20:10

kwakeroni