Catch Exceptions

Catching Exceptions

JSwat supports catching exceptions. This includes exceptions that are caught in the Java code running in the debuggee VM and exceptions that are not caught.

The catch command can be used to create an exception catch. There is also a dialog box available from the "Breakpoints" menu. Both the command and the dialog require the name of the exception to be caught. This must either be a fully-qualified class name or a wild-carded class name (i.e. has a '*' either at the beginning or end of the name).

Exception breakpoints can have both class and thread filters. See the breakpoints help for the section on setting up filters. The class filters apply to the class that is throwing the exception.

A single exception may be thrown multiple times. JSwat does not distinguish this case and so it may appear that more than one exception is being caught when in fact it is only one that has been rethrown.

JSwat always creates an invisible exception breakpoint for all uncaught exceptions. This breakpoint cannot be removed or modified as it is not visible to the user.