Selecting Exceptions for the Debugger to Catch (Integrated Debugger)

Usually, if an exception is thrown while a program is running, and the program does not catch it, the IDE Debugger opens and the offending thread is suspended.  However, if the program does catch it, the debugger will not open, and the program will continue.   Even if the program outputs the stack trace when it catches the exception, you might not be able to determine its origin.

To make debugging easier, the IDE debugger lets you effectively set breakpoints on exceptions, so that any time an exception of a certain type is thrown, the debugger suspends the thread that threw it and opens the Debugger browser.  You can then see where the exception is happening.

To select a type of exception to be caught by the debugger:

  1. Select Debug > Caught Exceptions from the Window menu, or click the Caught Exceptions toolbar button caughtexn.gif (1065 bytes) in the Debugger browser.
  2. From the list of available exception types, select the types of exceptions you want to set breakpoints on by enabling their check-boxes.  Note: You can select how the exception types are listed:  by exception type name, or by package name.
  3. Click OK.

Now when you run a program that throws an exception (of the type you selected), the thread is suspended and the Debugger browser opens, regardless of whether the program catches the exception.

Example: Opening the Debugger when an Exception is Thrown

ngrelc.gif (533 bytes)
The Integrated Debugger

ngrelt.gif (466 bytes)
Setting Breakpoints in Source Code