Setting Exception Breakpoints

Breakpoints are typically attached to a particular line of code; they pause the debugger when a particular line of code is about to be executed. Also, you can set a breakpoint to be activated when a certain type of exception is thrown. Exception breakpoints are not associated with a particular line of code.

To set an exception breakpoint:
  1. In the Breakpoints window, right-click and choose New Breakpoint.

    The New Breakpoint dialog appears.

  2. In the Definition tab, select the Exception Breakpoint from the dropdown list.

  3. In the Exception Breakpoint Details area, enter the fully qualified name for the exception.

  4. If desired, select or clear the Break for caught or Break for uncaught exceptions check boxes (both are selected by default).

  5. Click OK.

    The debugger will now pause if an exception of the specified type is thrown.

By default, the debugger automatically creates a persistent exception breakpoint for uncaught throws for java.lang.Throwable. This breakpoint will occur whenever an uncaught exception is thrown. You cannot delete a persistent breakpoint, although you can disable it


Related topics

About Breakpoints
Setting Source Breakpoints
Making a Breakpoint Conditional
About Grouped Breakpoints
About Verified and Unverified Breakpoints
Controlling Breakpoint Behavior
Disabling and Deleting Breakpoints