mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
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:
parent
b60d6348ed
commit
f6544ca25a
@ -1171,8 +1171,8 @@ def main():
|
|||||||
up.upload(fw, force=args.force, boot_delay=args.boot_delay)
|
up.upload(fw, force=args.force, boot_delay=args.boot_delay)
|
||||||
|
|
||||||
except RuntimeError as ex:
|
except RuntimeError as ex:
|
||||||
# print the error
|
# print the error and exit as a failure
|
||||||
print("\nERROR: %s" % ex.args)
|
sys.exit("\nERROR: %s" % ex.args)
|
||||||
|
|
||||||
except IOError:
|
except IOError:
|
||||||
up.close()
|
up.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user