Exit once there's an environment error (#71693)
Summary:
Narrow the scope of https://github.com/pytorch/pytorch/issues/69730.
Once there's an error, stop the script.
Since it's a random error, it most likely has something with the environment.
Let's see the stat.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71693
Reviewed By: seemethere, mikaylagawarecki
Differential Revision: D33742733
Pulled By: janeyx99
fbshipit-source-id: b453957c2cb450eb79b89614db426b50eef1d14f
(cherry picked from commit cd32fa53d994c4c4590cd7f4962671330eda28c1)