Breaking into the Debugger when an Exception is Thrown

Control how the debugger responds to exceptions.

When an application throws an exception during debugging, the debugger sees the exception before the program does. The debugger can allow the program to continue, or it can handle the exception itself. This is usually referred to as the debugger's first chance to handle the exception. If the debugger does not handle the exception, the program sees the exception. If the program does not handle the exception, the debugger gets a second chance to handle it.

You can control how the debugger handles exceptions by setting options in the Exceptions dialog box, which contains expandable groups like C++ Exceptions and Native Run-Time Checks. These groups and most of the exceptions in them are provided by Visual Studio, but among them is a subgroup of exceptions. By default, all PowerBuilder exceptions are set to continue.

The Exceptions dialog box enables you to control breaking on thrown and user-unhandled exceptions. You can also add and remove exceptions. See the Visual Studio help to learn about these and other features of the Exceptions dialog box.

To control how the debugger handles exceptions, you can change settings in the Exceptions dialog box at any time (not just in debug mode):

  1. Select Debug > Exceptions.
  2. Expand the Common Language Runtime Exceptions category, then expand the PowerBuilder Extensions category to see its subgroups and exceptions.
  3. Set the Thrown or User-unhandled property for any exception or category.
    Your settings are associated with the current workspace.