Add documentation for why we're catching all exceptions

We wish to distinguish between success, an abi break and a script
failure, so catch all uncaught exceptions and exit explicitly
with status 2
This commit is contained in:
Darryl Green 2019-04-18 14:59:51 +01:00
parent 4a483e4829
commit 62a18e32d0

View file

@ -393,7 +393,9 @@ def run_main():
abi_check = AbiChecker(old_version, new_version, configuration) abi_check = AbiChecker(old_version, new_version, configuration)
return_code = abi_check.check_for_abi_changes() return_code = abi_check.check_for_abi_changes()
sys.exit(return_code) sys.exit(return_code)
except Exception: except Exception: # pylint: disable=broad-except
# Print the backtrace and exit explicitly so as to exit with
# status 2, not 1.
traceback.print_exc() traceback.print_exc()
sys.exit(2) sys.exit(2)