bisect-kit: stop bisector for fatal errors
Some errors, e.g. incorrect command line argument, are fatal. Should
stop bisector instead of retrying them.
This CL also changed some non-fatal issues from assertion to normal
exceptions.
BUG=None
TEST=unittest
Change-Id: I0a6ffd0f697f4e79114d752585019e705e69c33f
Reviewed-on: https://chromium-review.googlesource.com/1795943
Tested-by: Zheng-Jie Chang <zjchang@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Commit-Ready: Zheng-Jie Chang <zjchang@chromium.org>
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Zheng-Jie Chang <zjchang@chromium.org>
Reviewed-by: Kuang-che Wu <kcwu@chromium.org>
diff --git a/switch_git.py b/switch_git.py
index bcc825d..3868578 100755
--- a/switch_git.py
+++ b/switch_git.py
@@ -28,6 +28,7 @@
def create_argument_parser():
parser = argparse.ArgumentParser()
+ cli.patching_argparser_exit(parser)
common.add_common_arguments(parser)
parser.add_argument(
'git_rev',
@@ -46,6 +47,7 @@
return parser
+@cli.fatal_error_handler
def main(args=None):
common.init()
parser = create_argument_parser()