Added a catch block to print extra information.