splitted catch block for JavaSE-1.6 compatibility