Add more protection to CleanStage from bad manifests.

Have CleanStage catch most exceptions generated by parsing the
manifest instead of just EnvironmentError.

TEST=Verified manifest parse error leads to buildroot clobber.

Change-Id: I90679e8a8fae62d8bb9601ad9cc6c9d9e42bdaee
Reviewed-by: Brian Harring <>
Commit-Ready: Ryan Cui <>
Tested-by: Ryan Cui <>
diff --git a/buildbot/ b/buildbot/
index 76d134f..a3c16a6 100644
--- a/buildbot/
+++ b/buildbot/
@@ -117,7 +117,9 @@
         manifest = cros_build_lib.ManifestCheckout.Cached(self._build_root,
-      except EnvironmentError, e:
+      except (KeyboardInterrupt, MemoryError, SystemExit):
+        raise
+      except Exception, e:
         # Either there is no repo there, or the manifest isn't usable.  If the
         # directory exists, log the exception for debugging reasons.  Either
         # way, the checkout needs to be wiped since it's in an unknown