Using old-style catch block for compatibility with older JDK.

This change enables older JDKs to compile the program.