views:

33

answers:

1

In Visual studio when an error happens during debug, the line causing the error is jumped to in the source code and the error displayed.

Is there a way with Elcipse to do the same? The Debug perspective appears, but the line causing the error and the error message are not immediately apparent.

+4  A: 

I'm assuming you are working with Java, so the answer is yes. You can tell Eclipse to break on exception. From the Run menu, select Add Java Exception Breakpoint.... Now, you need to select the Exception class. If you wish to stop on all Exceptions, you can use java.lang.Throwable. You can also specify whether to stop on caught or uncaught exceptions.

You can (and should) also use it for assertions, as I outlined in this post.

zvikico