catch the correct error in retry