Tools: uploader.py: exit with error on failure

- Script was already exiting at this point anyway, this just sets a non-zero program return code in the case of a failure
- Means programatic callers can detect if flashing fails, without needing to monitor (and parse) stdout
This commit is contained in:
ES-Alexander 2022-05-24 10:40:50 +10:00 committed by Peter Barker
parent b60d6348ed
commit f6544ca25a

View File

@ -1171,8 +1171,8 @@ def main():
up.upload(fw, force=args.force, boot_delay=args.boot_delay)
except RuntimeError as ex:
# print the error
print("\nERROR: %s" % ex.args)
# print the error and exit as a failure
sys.exit("\nERROR: %s" % ex.args)
except IOError:
up.close()