Added missing catch block for std::exception (#598)