In the Source Editor, you can quickly generate code for try-catch blocks or convert existing blocks into try-catch blocks.
To generate a try-catch block from a code template, do one of the following things in the Source Editor:
A try-catch block is generated. Your insertion point is left resting on the word Exception. You can then type in the exception that you want use.
To surround an existing group of statements with a try block:
A try block is created for code. If the IDE detects any uncaught exceptions, a catch block is inserted for each uncaught exception. If there are no exceptions, a finally block is inserted.