views:

28

answers:

0

I have a try-catch block like this:

try {
    // Some operation that might throw exception of type IOException
} catch (IOException e) {
    // Use LOG here...
}

I want to create an eclipse template that when used INSIDE the catch block, yields the following:

catch(IOException e) {
    LOG.error("IOException: ", e);
}

Help me how to accomplish this.

NOTE: Code templates is not an option here as it produces a complete try-catch... but what I wanted here is just the body for the catch block.