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/bisect_kit/codechange.py b/bisect_kit/codechange.py
index 554f2a6..7649316 100644
--- a/bisect_kit/codechange.py
+++ b/bisect_kit/codechange.py
@@ -809,7 +809,8 @@
if matched_index is None:
if i in (0, len(fixed_specs) - 1):
logger.error('essential spec mismatch, unable to continue')
- assert 0, 'Bisector cannot deal with this version range.'
+ raise ValueError('Commit history analyze failed. '
+ 'Bisector cannot deal with this version range.')
else:
logger.warning('%s do not match, skip', fixed_spec.name)
continue