Exception handling for lhapdf test in mcgrid test